nihad640 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

Problem with ComboBoxItem when changing content of ValueMap after selection had been changed #634

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

1.Using attached file
2.The button change the content of the valueMap
3.Everything is ok when I don't try to select a value from the combo
4. As soon as select a value the switch of the values is done but the first 
option is not shown anymore.

Besides I'm obliged in both case to invoke redraw, I don't know if it's normal

Windows7 or Xp Firefox

Regards
Alain

Original issue reported on code.google.com by albu.con...@gmail.com on 15 Oct 2011 at 7:52

Attachments:

GoogleCodeExporter commented 9 years ago
This appears to be behaving as intended. Specifically:
- When "addUnknownValues" is true (the default), you can use the free-form text 
entry box of a combobox item to specify a value that is not present in the list 
of options (similar to the URL bar in a browser). In your use case the user is 
selecting a value from one valueMap, then you're programatically changing the 
valueMap to a new map that doesn't include the selected item. When you re-show 
the pick-list the newly specified valueMap (not including the user-entered 
value) is shown. This is actually as expected - it'd be the same if the user 
entered some random string and showed the pickList -- it wouldn't contain the 
random string, just the entries present in the valueMap.
- The defaultToFirstOption setting essentially sets up a (dynamic) default 
value for the item. Calling "redraw()" is required to re-evaluate this. Our 
design team will consider whether we could make this more intuitive but it's 
working as currently designed.

If you feel like you can't get the behavior you need in your application, it 
might help if you lay out your use case / what you're trying to do as clearly 
as possible

Thanks
Isomorphic Software

Original comment by smartgwt...@gmail.com on 17 Oct 2011 at 8:45

GoogleCodeExporter commented 9 years ago
Many thanks for the clear answer. I will modify my code accordingly to the 
details provided.
Regards
Alain BUFERNE

Original comment by albu.con...@gmail.com on 18 Oct 2011 at 5:33