Hi..
M trying to load a grid with a datasource received from the server. The grid loads fine. From the grid, I fill a form as in the Pattern Reuse example. The values are editable in the form and on grid.updateData(), it loads back the updated form values into the grid.
My problem is this sequence works fine in google chrome, but fails to work in Mozilla. It works only till loading the grid in Mozilla and fails after that.
Will paste a snapshot of the code which takes care of this.
final ListGrid grid = new ListGrid();
grid.setDataSource(dataSource);
grid.setWidth("100%");
grid.setHeight("50%");
grid.setAutoFetchData(true);
grid.setCanEdit(true);
grid.setCanSort(true);
grid.setAlign(Alignment.CENTER);
final DynamicForm form = new DynamicForm();
form.setDataSource(dataSource);
form.setAlign(Alignment.CENTER);
final IButton updateButton = new IButton("Update Records");
updateButton.setAlign(Alignment.RIGHT);
grid.addRecordClickHandler(new RecordClickHandler() {
public void onRecordClick(RecordClickEvent event) {
form.clearErrors(true);
form.editRecord(event.getRecord());
updateButton.enable();
}
});
updateButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
System.out.println("form:"+form);
System.out.println(form.getValueAsString("name"));
ListGridRecord record = grid.getSelectedRecord();
record.setAttribute("name",form.getValueAsString("name"));
record.setAttribute("description",form.getValueAsString("description"));
grid.updateData(record);
}
});
I am unable to figure out why this happens coz its just the most basic code.