Doubts on EditorFrameWork

38 views
Skip to first unread message

Qrunk

unread,
Jan 18, 2012, 5:19:28 AM1/18/12
to google-we...@googlegroups.com
Hi Thomas, 

Currently we are using SimpleEditorDriver to bind data into our UI. We are facing a few problems in it

1. We can only bind a single property at a time, say like we cant bind a list of data to DataGrid/ComboBox , we have to set the List data through a separate method,
  databinding can happen only for a single property, using driver.edit(model), here we are passing only one property. Which again makes us pass the List of data to the widget(say in ValueListBox we have to set the 

void setOneListBox(List<One> models)
{
//oneListBox is the ValueListBox


        oneListBox.setAcceptableValues(models);
}


Now again if I have 4 ValueListBoxes I will have to write 4 different methods to set data into all our ValueListBoxes, some thing like this,

void setTwoListBox(List<Two> models)
{
// twoListBox  is the ValueListBox 
        twoListBox.setAcceptableValues(models);
}


void setThreeListBox(List<Three> models)
{
// threeListBox  is the ValueListBox 
        threeListBox.setAcceptableValues(models);
}

void setFourListBox(List<Four> models)
{
// fourListBox  is the ValueListBox 
       fourListBox.setAcceptableValues(models);
}



I will have the same problem when we have to deal with DataGrid. 
How can we avoid this using EditorFrameWork ??




Thomas Broyer

unread,
Jan 19, 2012, 10:50:24 AM1/19/12
to google-we...@googlegroups.com
A ValueListBox allows you to select a single value one, among a list of acceptable values. The Editor framework is only responsible for selecting the value and then retrieving the selected value.

As for lists of values, have a look at CompositeEditor, ListEditor and HasDataEditor: http://code.google.com/webtoolkit/doc/latest/DevGuideUiEditors.html#CompositeEditor (and have a look at the sample code linked next to ListEditor)
Reply all
Reply to author
Forward
0 new messages