Hi,
I encountered the following problem (bug?) when using DynamicForms:
Here is my class:
You can notice that the SelectItem gets the data from another datasource and that setDefaultToFirstOption(true) is called.
The first time I create and show an instance of this dynamicform. Everything is ok: the SelectItem fetches all the data and the first item is selected by default (ID: 1).
The second time (though it's an other instance), very surprisingly, the SelectItem does contain all the items but the first one is not selected (it's blank)... but the value is instead set into the second item of the form (I've got the "1" value in my text field). This seems very odd but I did not add any code which could lead to such a behaviour...
Thanks a lot for your help!
Thomas
I encountered the following problem (bug?) when using DynamicForms:
Here is my class:
Code:
class NewOperatorForm extends DynamicForm { NewOperatorForm() { TextItem loginItem = new TextItem(DSOperator.LOGIN, "Login"); TextItem nameItem = new TextItem(DSOperator.NAME, "Name"); TextItem departmentItem = new TextItem(DSOperator.DEPARTMENT, "Department"); TextItem emailItem = new TextItem(DSOperator.EMAIL, "Email"); SelectItem bunitItem = new SelectItem(DSOperator.BUNIT_ID, "Business Unit"); bunitItem.setOptionDataSource(DataSource.get(DSBusinessUnit.DS_NAME)); bunitItem.setAutoFetchData(true); bunitItem.setDefaultToFirstOption(true); this.setDataSource(DataSource.get(DSOperator.DS_NAME)); this.setItems(bunitItem, loginItem, nameItem, departmentItem, emailItem); Record r = new Record(); this.editNewRecord(r); } }
The first time I create and show an instance of this dynamicform. Everything is ok: the SelectItem fetches all the data and the first item is selected by default (ID: 1).
The second time (though it's an other instance), very surprisingly, the SelectItem does contain all the items but the first one is not selected (it's blank)... but the value is instead set into the second item of the form (I've got the "1" value in my text field). This seems very odd but I did not add any code which could lead to such a behaviour...
Thanks a lot for your help!
Thomas
Comment