GWT - ListBox - pre-selecting an item
Posted
by rgoytacaz
on Stack Overflow
See other posts from Stack Overflow
or by rgoytacaz
Published on 2009-09-17T18:30:11Z
Indexed on
2010/04/12
0:13 UTC
Read the original article
Hit count: 634
Hey there Stackoverflow,
I got a doubt regarding pre-selecting(setSelectedIndex(index)) an item in a ListBox, Im using Spring + GWT.
I got a dialog that contains a painel, this panel has a flexpanel, in which I've put a couple ListBox, this are filled up with data from my database.
But this painel is for updates of an entity in my database, thus I wanted it to pre-select the current properties for this items, alowing the user to change at will.
I do the filling up in the update method of the widget.
I tried setting the selectedItem in the update method, but it gives me an null error.
I've searched a few places and it seems that the listbox are only filled at the exact moment of the display. Thus pre-selecting would be impossible.
I thought about some event, that is fired when the page is displayed.
onLoad() doesnt work..
Anyone have something to help me out in here?
Thx in advance,
Rodrigo Dellacqua
© Stack Overflow or respective owner