Hello everybody,
i am facing a problem that i am not able to handle. My goal is to bind a Dynamic Form to a ListGrid in order to use the form to change records that are displayed in the grid.
The DataSource is a RestDataSource that is calling a servlet that return the expected XML data. Fetch operation uses GET, update uses POST. The update operation does not return a response, but updates the data on the serverside. A new fetch operation will get the updated data.
The update operation doesnt work like expected. After saving the form by hitting the button, the data is updated serverside but the grid displays the data before the update.
Is it possible that the grid updates itself after saving the changed data ito the datasource?
Best Regards and thanks in advance
Jakob
i am facing a problem that i am not able to handle. My goal is to bind a Dynamic Form to a ListGrid in order to use the form to change records that are displayed in the grid.
Code:
//the datasource final POGridDS poDs = DataSourceFactory.getInstance().getPoDataSource(); //the grid that displays the reports data final ListGrid poGrid = createGrid(poDs); //the detailform to edit a record final DynamicForm detailForm = createDetailForm(poDs); //the clickhandler that is responsible for giving the editing possibility in the form poGrid.addRecordClickHandler(new RecordClickHandler() { public void onRecordClick(RecordClickEvent event) { detailForm.reset(); detailForm.editSelectedData(poGrid); } }); IButton updateButton = new IButton("Save"); updateButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { detailForm.saveData(); } }); private DynamicForm createDetailForm(POGridDS ds) { DynamicForm form = new DynamicForm(); form.setIsGroup(true); form.setGroupTitle("Update"); form.setNumCols(4); form.setLongTextEditorThreshold(201); form.setDataSource(ds); return form; } private ListGrid createGrid(POGridDS ds) { final ListGrid list = new ListGrid(); list.setHeaderHeight(20); list.setWidth100(); list.setHeight100(); list.setDataSource(ds); list.setAutoFetchData(true); list.setAlternateRecordStyles(true); list.setShowAllRecords(false); list.setShowFilterEditor(true); list.setDataPageSize(50); list.setAutoFitData(Autofit.HORIZONTAL); list.setAutoFitMaxColumns(7); list.setFilterOnKeypress(false); //every time a key is pressed the data is filtered list.setLongTextEditorThreshold(201); //the size of the column for which on other filter is displayed list.setOverflow(Overflow.AUTO);// return list; }
The update operation doesnt work like expected. After saving the form by hitting the button, the data is updated serverside but the grid displays the data before the update.
Is it possible that the grid updates itself after saving the changed data ito the datasource?
Best Regards and thanks in advance
Jakob
Comment