I have a set of forms that are all created using the following method.
I also have a button that calls the same savePo() method. Clicking the button works fine, but pressing Enter on any of the forms does not invoke the savePo() method. Instead it attempts the standard ValuesManager.saveData(). Do I need to override ValuesManager.saveData() as well?
Also, I think I only need to override the saveData() method on each form, not also add a SubmitValuesHander, correct?
Code:
private DynamicForm getStandardForm() { DynamicForm stdForm = new DynamicForm() { @Override public void saveData() { savePo(null); } }; stdForm.setValidateOnExit(true); stdForm.setSelectOnFocus(true); stdForm.setWrapItemTitles(false); stdForm.setNumCols(4); stdForm.setFixedColWidths(false); stdForm.setDataSource(poHeaderDS); stdForm.setSaveOnEnter(true); poHeaderVM.addMember(stdForm); stdForm.addSubmitValuesHandler(new SubmitValuesHandler() { @Override public void onSubmitValues(SubmitValuesEvent event) { savePo(null); } }); return stdForm; }
Also, I think I only need to override the saveData() method on each form, not also add a SubmitValuesHander, correct?
Comment