20 Jul 2010 12:01 PM #1
[FNR] FormPanel/FormField validation issue with error icons
I've run across several issues that I can't seem to fix or workaround in GXT's FormPanel/FormField validation.
I've attached code to demonstrate the issue; the classes are in the .zip file along with a couple screenshots.
I am running with GXT 2.1.1 and GWT 2.0.3, on Mac OS/Firefox 3.6.6 (also reproducable on Ubuntu/Firefox 3.5.9). I can also reproduce this in both development and production mode.
I basically have a FormPanel underlying a TabPanel with multiple tabs. When I hit the Save button, I want the fields on all the tabs to be validated (and marked invalid if they're not valid). And when I hit the Reset Button I want the original values restored (and any fields that were marked invalid should have those errors cleared). Pretty basic really.
Here's the issues I am seeing when I run the attached code:
1. The error icons on the fields in tabs that are not currently visible are displayed in the wrong place when I visit the other tab. (i.e. in the example, bring up the app, hit Save, then go to the 2nd tab where you can see that the error icons are not displayed properly to the right of the field.) I have attached a screenshot of this in FF 3.5.9. It happens in IE8 as well - the icons are just a little further right, but still in the middle of the Field).
I figured out that I had to do a tabPanel.setDeferredRender(false); in order to render all the tabs immediately so that fields in tabs not currently showing would get marked as invalid, but I can't figure out how to fix this placement issue.
2. The error icons for CheckBoxGroup and RadioGroup fields are not cleared when I do a formPanel.reset()
(i.e. in the example, bring up the app, go to the 2nd tab, hit Save, then hit Reset and you can see that the error icons are not cleared on the 'Music' CheckBoxGroup or the 'Favorite Color' RadioGroup)
3. Lastly, the Events.Invalid event is being fired during a formPanel.reset(). It seems like that should only be fired during the formPanel.isValid() call? If I'm resetting fields and removing their validation errors using a formPanel.reset() call, I would not expect to get Events.Invalid events on those fields. Seems odd?
Any help much appreciated since issue #1 in particular is a fairly large issue for me.
20 Jul 2010 12:03 PM #2
For point 1) you need to change the hidemode of the tabitems to HideMode.OFFSET
20 Jul 2010 12:10 PM #3
20 Jul 2010 12:34 PM #4
2) is fixed now in SVN as of revision 2148
3) is fixed now in SVN as of revision 2149
20 Jul 2010 1:20 PM #5
Yep - HideMode.OFFSET does indeed seem to take care of the error icon placement issue. Thanks for the quick response this time.
Question though - when I make that change to the sample app I sent you, I notice that the actual checkbox in the CheckBox field in the second tab aligns differently. The actual checkbox moves to the right (looks like it is centered now) rather than being left aligned? Is there a setting I'm missing to fix that? Looks like if I do a cb.el().firstChild().setLeft(0) post-render, then I can get it back to being left-aligned; was just hoping there was some more obvious fix instead?
20 Jul 2010 1:24 PM #6
That is how it should be as there is no boxlabel.
By jopelkeyca in forum Ext GWT: DiscussionReplies: 2Last Post: 21 Jul 2010, 1:25 AM
By jhook in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 6 Nov 2009, 2:16 PM
By skaue in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 17 Oct 2008, 2:58 AM
By mcohnen in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 31 Oct 2007, 8:29 AM
By cmd.ares in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 21 Jul 2007, 9:23 PM