PDA

View Full Version : How to update a text of the item of the DataList in runtime?



obender
13 Jun 2008, 12:45 PM
The obvious call dataList.getItem(idx).setText("XXX") just doesn't seem to work. And again this worked back in myGWT times.



Viewport mainViewPort = new Viewport();
mainViewPort.setLayout( new FitLayout() );

LayoutContainer mainContainer = new LayoutContainer();

final DataList dl = new DataList();
dl.add( new DataListItem("XXX") );

Button bt = new Button("Change");
bt.addSelectionListener( new SelectionListener<ComponentEvent>(){
public void componentSelected( ComponentEvent ce ) {
dl.getItem(0).setText( "YYY" );
}
} );

mainContainer.add( dl );
mainContainer.add( bt );

mainViewPort.add(mainContainer);
RootPanel.get().add(mainViewPort);

sdc
23 Jun 2008, 3:23 AM
It looks fixed in RC1