#7011 closed defect (fixed)
[patch] [cla] ValidationTextBox reset() doesn't reset field error message and status
Reported by: | guest | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit - Form | Version: | 1.1.1 |
Keywords: | ValidationTextBox | Cc: | |
Blocked By: | Blocking: |
Description (last modified by )
Problem:
- Have a ValidationTextBox in a Dialog
- Open the dialog
- Enter something invalid
- Error message is displayed
- Cancel and hide the dialog
- Re-open the dialog
- Error message and state is visible (i.e. not reset)
Solution: Overload the reset() method to reset the messages and state.
Notes: It would be nice if dijit.Dialog.show() reset the fields for you:
dojo.forEach(this.getDescendants(), function(w){ if(w.reset){ w.reset(); } });
-Chris Barber
Attachments (1)
Change History (8)
Changed 14 years ago by
Attachment: | ValidationTextBox reset.patch added |
---|
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 14 years ago by
Owner: | set to Douglas Hays |
---|
comment:3 Changed 14 years ago by
Owner: | changed from Douglas Hays to bill |
---|
This is an enhancement request for Dialog. There probably needs to be a flag to reset or not since some Dialog's probably need persistence of values.
ValidationTextBox? already resets the error state.
Run dijit/tests/form/test_validate.html
Search for the "euro currency" textbox and enter some letters.
Press the Reset button and the error disappears.
comment:4 Changed 14 years ago by
Owner: | changed from bill to Douglas Hays |
---|
Doug, I added this.reset() to Dialog.show() and it mostly works, but in test_Dialog.html, on the first dialog, the DateTextBox isn't cleared. Can you fix that?
I'm still thinking about whether there should be a resetOnShow widget attribute, or show() should take a reset flag, but in any case need to fix that DateTextBox problem.
comment:5 Changed 14 years ago by
Owner: | changed from Douglas Hays to bill |
---|
DateTextBox? reset problem fixed. Awaiting resolution on the resetOnShow attribute for the Dialog enhancement.
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
OK, I don't think I'm going to add an automatic way for Dialog to reset at this point... developer can just call Dialog.reset() before calling Dialog.show(). The other part about ValidationTextBox (which is the main issue in this ticket) is already fixed, so closing.
comment:7 Changed 11 years ago by
Component: | Dijit → Dijit - Form |
---|
OK, there are two issues here: