Unanswered: Validation on Read-Only document
My application has a document that contains a button to move it from a "Draft" state to a "Publish" state. The document itself is in "view-mode" meaning that all the model data within is displayed using a combination of content panels and HTML span elements. When the document goes from Draft to Publish, all of the data within the model has to be validated. I'd like to reuse some of the validation icons/tooltip messages that is used in the TextField components to keep the user experience consistent. Is it possible to do something like this?
For example, I'd like to show the "!" icon next to the Admin heading and the Description label below, with a tooltip explaining what the error is:
<gxt:FramedPanel ui:field="adminFrame" headingText="Admin">
<span class="fieldText" ui:field="nameFld"/>
<span class="fieldText" ui:field="addressFld"/>
<span class="fieldText" ui:field="descFld"/>
The errors on fields are drawn by one of the four built-in ErrorHandler classes. They are designed to modify a widget to either show or clear errors. It may be possible for you to use them outside of the Fields they were built to work with. The default is a SideErrorHandler, which draws the '!' icon off to the right - that would probably be a good place to start.
Thanks, I was looking into that, but in order to mark a section invalid to display the "!" icon using the markInvalid() method, you have to pass in a list of EditorError. EditorError has to be linked to an Editor, and I don't have one of those on my document.
I'm kind of heading in that direction where I can use the same TipAppearance and image that SideErrorHandler uses, but the trick is trying to get it to display in the ContentPanel header. I can't use the addTool() method, since it needs to go to the left of the heading text, e.g.:
Tags for this Thread