ravisangar / smartgwt

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

ListGrid, Field with valueMap have a weird behavior during editing when canToggle=true #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. take the sample
http://www.smartclient.com/smartgwt/showcase/#grid_editing_cell
2. after the field continentField creation, add setCanToggle(true); 
3. You see that when you enter editing mode, the selected value is not the
good one. It's the supposed selected value +1 that is eventually selected

What is the expected output? What do you see instead?
When you enter edit mode, a pick list is shown. It's supposed to have the
current value to be selected. Instead, the value just below is selected

What version of the product are you using? On what operating system?
last SVN build (as of 04/02/09)

Original issue reported on code.google.com by ricard.i...@gmail.com on 6 Feb 2009 at 10:40

GoogleCodeExporter commented 9 years ago
For boolean, or valueMapped fields, setting canToggle on a field means that 
when the
user single-clicks on the field, the value is advanced to the next possible 
value.
For boolean fields this toggles between true and false - for valueMapped fields 
it
advances to the next option in the valueMap.

If you also have the editEvent set to ListGridEditEvent.CLICK as in this 
example, the
editor (a select item) will then show, with the new value.
For a boolean field (showing a checkbox type editor) this is what you'd expect.
For a valueMapped field showing a select type editor, this is somewhat counter 
intuitive.

So essentially this is working as designed though it's an odd use case - you 
wouldn't
usually set canToggle on a valueMapped field if the grid's editEvent was click.

Can you comment on why you need canToggle to be true for this field?

Original comment by smartgwt...@gmail.com on 21 Feb 2009 at 1:24

GoogleCodeExporter commented 9 years ago
I don't need canToggle. It's just that i had a loop for creating all my field 
and the
Toggle was set for all my fields. The doc doesn't clearly state that it choose 
the
next value for a valueMap, it just talks about the behavior in the case of a 
boolean
field. So, maybe the comment of the method should be updated to reflect the 
behavior
in such an odd case ;-)

Thank for your reply 

Original comment by ricard.i...@gmail.com on 23 Feb 2009 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 23 Feb 2009 at 10:01