Announcement

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

    SaveOnEnter(true) not working with multiple forms and a ValuesManager

    I have a set of forms that are all created using the following method.
    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;
    }
    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?

    #2
    Any advice here?

    Comment


      #3
      You should see the submitValuesHandler on the VM called when you press enter in the member forms. Can you flesh this out into a test case so we can run it?

      Comment


        #4
        There is no submitValuesHandler on the VM, only on all of the member forms. There is no method for ValuesManager.addSubmitValuesHandler(). Am I supposed to override the ValuesManager.submit() method?

        Comment


          #5
          addSubmitValuesHandler() should be present on valuesManager (we added it this week). Can you verify with the latest nightly and let us know if you still don't see it

          Thanks

          Comment


            #6
            It's there now and works as expected. Thanks.

            Comment

            Working...
            X