Use AjaxFormSubmitBehavior instead of AjaxFormComponentUpdatingBehaviour.

AjaxFormComponentUpdatingBehaviour is just for updating a single field in a form.

AjaxButton uses AjaxFormSubmitBehaviour internally so look at that for an example.

Mike
Can you submit all of the data on a form based on an onchange event?

Is adding javascript the only way to submit the data?

Pseudo Code:

Panel {

   Form form = new Form(new CompoundPropertyModel());
   add(form);
   form.add(new TextField("val");
   form.add(childList = new DropDownChoice());
   childList.add( new AjaxFormComponentUpdatingBehavior("onchange") {


       protected void onUpdate( final AjaxRequestTarget target ) {

            /// Tried clearing the messages here, does not work.

           Line12: form.getObjectModel().setVal("Hello");
target.addComponent(panel);

            target.addComponent(form);

       }

   });

   form.add(new MyValidator());
   form.add(new AjaxSubmitLink(form)) {

      onSubmit() {
         save();
         moveToNextScreen();
      }

   }


}



Berlin Brown



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to