hi Isomorphic,
After the update smartgwt from 2.5 to 3.1, I have encountered a different behavior at FormItemValueFormatter - getSelectedRecord.
The function getSelectedRecord returns a record although none has been selected.
In smartgwt version 2.5, no text will be displayed initially.
To reproduce the problem, please paste the code in the test program buildinds.
Used:
OS: MacOS 10.8
Browser: FF 9
smartgwt: SNAPSHOT_v8.3d_2012-10-10/PowerEdition Deployment 2012-10-10
gwt: 2.4
best regards,
timo
After the update smartgwt from 2.5 to 3.1, I have encountered a different behavior at FormItemValueFormatter - getSelectedRecord.
The function getSelectedRecord returns a record although none has been selected.
In smartgwt version 2.5, no text will be displayed initially.
To reproduce the problem, please paste the code in the test program buildinds.
Code:
DynamicForm animaldynamicForm = new DynamicForm();
final SelectItem animalsSel = new SelectItem("animalsSel");
animalsSel.setTitle("Animals Selection");
animalsSel.setWidth(200);
animalsSel.setOptionDataSource(DataSource.get("animals"));
animalsSel.setPickListFields(new ListGridField("lifeSpan"), new ListGridField("diet"));
animalsSel.setValueFormatter(new FormItemValueFormatter() {
@Override
public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
if (item.getSelectedRecord() != null){
return item.getSelectedRecord().getAttribute("lifeSpan") + " (" + item.getSelectedRecord().getAttribute("diet") + ")" ;
}
return null;
}
});
animaldynamicForm.setItems(animalsSel);
animaldynamicForm.draw();
OS: MacOS 10.8
Browser: FF 9
smartgwt: SNAPSHOT_v8.3d_2012-10-10/PowerEdition Deployment 2012-10-10
gwt: 2.4
best regards,
timo
Comment