#11630 closed defect (invalid)
FilteringSelect SetValue() - Shows Invalid Icon But Valid Item Remains
Reported by: | mark007 | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | Dijit - Form | Version: | 1.5 |
Keywords: | Cc: | Douglas Hays | |
Blocked By: | Blocking: |
Description (last modified by )
Hi,
I have found a niggle with FilteringSelect that has effected many of my web tools. I have some dijit FilteringSelect's with a set range of options.
When I set the value using
dijit.byId("filtering").setValue("valid");
with "valid" being a valid item, all is fine, but if I then use
dijit.byId("filtering").setValue("invalid");
with "invalid" not being a valid item, I get the yellow warning icon inside of the FilteringSelect indicating the value is not valid BUT the old "valid" value still remains. This shouldn't be the case. I would expect the invalid value to appear in the FilteringSelect and show the invalid icon.
Test Case Attached.
Attachments (1)
Change History (5)
Changed 9 years ago by
comment:1 Changed 9 years ago by
Component: | General → Dijit |
---|---|
Description: | modified (diff) |
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 9 years ago by
Thanks Bill, I'll begin to change my code to use displayedValue for FilteringSelects?.
I feel that setting a value of "XX" as you descibe above, that has no state with abbreviation of "XX" should have a different behaviour. Instead of leaving the value that was there previously, which is most definitely the wrong displayed value, an empty string perhaps would be more valid IMHO.
comment:3 Changed 9 years ago by
Cc: | Douglas Hays added |
---|
Yah, I agree, but there was some implementation detail that made doing that difficult, Doug can explain better why it doesn't work that way?
comment:4 Changed 9 years ago by
Component: | Dijit → Dijit - Form |
---|
It can't work that way because FilteringSelect has a mapping betweeen value and displayed value. For example, in a FilteringSelect for U.S. state, you do
and then it displays "California". But if you do:
it doesn't know what to display because there's no state with the abbreviation of "XX".
Likely what you want is to be setting displayedValue, you can try
Set() is new for 1.5. Previously it was called attr()