In a UiBinder file, I define a combo box in a HBoxLayoutContainer (along with some other components that are displayed fine):
Code:
<container:child layoutData="{boxLayoutData_MarginRight}">
<form:FieldLabel text="Granularity">
<form:widget>
<form:ComboBox ui:field="granularityCombo"
allowBlank="false" triggerAction="ALL"/>
</form:widget>
</form:FieldLabel>
</container:child>
In the Java code, I define it as:
Code:
GranularityProperties m_props = GWT.create( GranularityProperties.class );
ListStore<Granularity> m_store = new ListStore<Granularity>( m_props.key() );
@UiField(provided = true)
ComboBox<Granularity> granularityCombo;
and in the asWidget() method, I create it:
Code:
granularityCombo = new ComboBox<Granularity>( m_store, m_props.name() );
GranularityServiceAsync service = (GranularityServiceAsync) GWT.create( GranularityService.class );
final AsyncCallback<List<Granularity>> callback = new AsyncCallback<List<Granularity>>()
{
@Override
public void onSuccess( List<Granularity> result )
{
System.out.println("OK with " + result);
m_store.addAll( result );
}
@Override
public void onFailure( Throwable caught )
{
// Log error? Display message...
System.out.println("Oops " + caught);
}
};
service.getGranularities( callback );
My service works, I get data in the result parameter.
But the combo box is empty, displayed as a button with a >> content, showing a tiny empty list.
Does the combo box support filling the store asynchronously as above?
The GXT Demos/examples get their data from the client side, so it is hard to tell if I make a mistake or if that's a bug in the Beta 2.