Announcement

Collapse
No announcement yet.
X
  • 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 http://forums.smartclient.com/showthread.php?t=19022:

    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:
    Code:
    final IButton okBtn = new IButton("OK", new ClickHandler() {
    	@Override
    	public void onClick(ClickEvent event) {
    		boundFormValuesManager.saveData(new DSCallback() {
    			@Override
    			public void execute(DSResponse response, Object rawData, DSRequest request) {
    				if (Helper.oneRow(response)) {
    					boundFormValuesManager.clearValues();
    					parent.destroy();
    				}
    			}
    		});
    	};
    }) {
    	{
    		setWidth(100); // Button
    	}
    };
    In case you need it also this code:
    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?

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