No announcement yet.
  • Filter
  • Time
Clear All
new posts

    DynamicForm with ValuesManager and setSaveOnEnter(true) problem

    Hi Isomorphic,

    I'm on FF19, SmartGWT v8.3p_2013-03-11 and found following problem, which might be related to

    My usecase is a form with behaves like a MS-Windows Window. It has 3 buttons (OK, Cancel, Apply). "OK" saves and closes, Cancel cancels and Apply saves without close.
    For example, the event handels for the OK buttons is:
    final IButton okBtn = new IButton("OK", new ClickHandler() {
    	public void onClick(ClickEvent event) {
    		boundFormValuesManager.saveData(new DSCallback() {
    			public void execute(DSResponse response, Object rawData, DSRequest request) {
    				if (Helper.oneRow(response)) {
    }) {
    		setWidth(100); // Button
    In case you need it also this code:
    public static boolean oneRow(DSResponse dsr) {
    	return (dsr.getStatus() == DSResponse.STATUS_SUCCESS && dsr.getTotalRows() == 1);
    This works fine. Now, to behave like a windows window, it also has to "save and close" on "Enter".
    This works with setSaveOnEnter(true), but only for forms without a ValuesManager.
    In these I subclass the DynamicForm and @Overwrite onSave(). After a successfully save, I destroy the form.

    When I use a values-manager, the overwritten onSave() is not called (I tried all three signatures). Also, the onSave(...) on my ValuesManager, which I also overwrote, are not called. The form saves as expected, but my code is not run.
    I placed a breakpoint in all overwritten methods, none was hit. Do you know if there is a problem with this? Is my approach correct?

    Last edited by Blama; 22 Mar 2013, 07:17. Reason: typos, clarifying