I have a FilterBuilder showing a SelectItem for a certain field, but I've not yet found a clean way to sort the SelectItem values.
Let me explain:
My FilterBuilder uses a datasource defined as follows
as depicted in http://forums.smartclient.com/showthread.php?t=13775.
If I use the SelectItem in a form I can simply call setSortField on it and it works. But calling this method on a SelectItem used as editorType on the field seems not enough...
Moreover I noticed that if I use the form then the FilterBuilder works fine!?!
Could you please give me some explanations?
I'm attaching a simple test case.
At client side I'm using
SmartClient Version: SC_SNAPSHOT-2010-11-03/LGPL Development Only (built 2010-11-03)
GWT 2.0.4
Firefox 3.6.12
Kind regards
Davide
UPDATE: Obviously, adding a DynamicForm with the SelectItem is not a viable workaround (besides being an ugly solution) since if the form is not visible the FilterBuilder drop-down remains unsorted...
Let me explain:
My FilterBuilder uses a datasource defined as follows
Code:
... final DataSourceIntegerField optionField = new DataSourceIntegerField ("option", "OPTION"); //NEEDED to let the filter builder show a drop-down list final SelectItem optionsItem = new SelectItem (); optionsItem.setName (optionField.getName ()); optionsItem.setOptionDataSource (getOptionDataSource ()); optionsItem.setValueField ("id"); optionsItem.setDisplayField ("name"); //USELESS optionsItem.setSortField ("name"); optionField.setEditorType (optionsItem); mainDataSource.addField (optionField); ...
If I use the SelectItem in a form I can simply call setSortField on it and it works. But calling this method on a SelectItem used as editorType on the field seems not enough...
Moreover I noticed that if I use the form then the FilterBuilder works fine!?!
Could you please give me some explanations?
I'm attaching a simple test case.
At client side I'm using
SmartClient Version: SC_SNAPSHOT-2010-11-03/LGPL Development Only (built 2010-11-03)
GWT 2.0.4
Firefox 3.6.12
Kind regards
Davide
UPDATE: Obviously, adding a DynamicForm with the SelectItem is not a viable workaround (besides being an ugly solution) since if the form is not visible the FilterBuilder drop-down remains unsorted...
Comment