Opened 14 years ago
Closed 14 years ago
#1485 closed defect (fixed)
Select widget setValue() function cannot work
Reported by: | bill | Owned by: | Douglas Hays |
---|---|---|---|
Priority: | high | Milestone: | 0.9 |
Component: | Widgets | Version: | 0.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The value of a Select widget, just like the value of a <select> element, is the hidden value, not the label (ex, although the Select widget displays "California", the value is "CA").
So getValue() should return "CA", and more importantly, calling setValue("CA") should set display "California".
As Joose pointed out, in order for that to work, a dataUrl based Select widgets needs to query the server and say "what's the label corresponding to 'CA'?". Currently there's no defined interface to do this.
The alternative is to make setValue() take both the value and the label (which is ugly because it's inconsistent with all the other form widgets), or to disallow setValue() (which is also ugly for the same reason, and also because it breaks FormContainer?), or maybe some other alternative I haven't thought of. Anyway, have to make a decision on that.
Change History (3)
comment:1 Changed 14 years ago by
Owner: | changed from bill to Douglas Hays |
---|
Select's setValue (now) takes the hidden value. getValue returns the hidden value. setValue applies the corresponding label by reverse lookup.