this problem has been fixed. here's the CVS commit comment i put in:

Form validation now occurs for every form submit in Form.onValidate().
If the form validates, Form.onSubmit is called unconditionally. If
there is more than one button on the form and the form validates, then
Button.onSubmit() is also called. Since multi-button forms (which are
a common case) are unlikely to want to override Form.onSubmit(), made
this method non-abstract.


so you can remove your Form.onSubmit() override and your code should work as you expected it would. if your form validates, your button's onSubmit() will be called after the model is updated and you can do your processing as desired.

best,

        jon

Matthew Watson wrote:

I'm working on a wizard that includes three buttons: cancel, save,
next.

The wizard extends WebPage, which imbeds a form that in turn includes
three buttons. See below:

public class Wizard extends WebPage {

   public Wizard() {
       super();
       add(new WizardForm("form"));
   }

   private class WizardForm extends Form {

       public WizardForm(String s) {
           super(s);

CompoundPropertyModel model = new CompoundPropertyModel(new
Person()); setModel(model);


           add(new TextArea("summary"));
           add(new TextArea("description"));

           add(new CancelButton());
           add(new SaveButton());
           add(new NextButton(Whatever.class));
       }

       protected void onSubmit() {
       }
   }
}


public class SaveButton extends Button {

   public SaveButton() {
       super("save");
   }

   protected void onSubmit() {
       Person person = (Person) getParent().getModelObject();

       MockDatabase.getInstance().addPersont(person);

       RequestCycle cycle = getRequestCycle();
       cycle.setResponsePage(new People());
       cycle.setRedirect(true);
   }
}

When the save button is pressed the above is executed. However
regardless of what I type into the html form the values I enter for
summary + description never get set on the person object.

I've more or less followed the guestbook example, but I don't
understand why they aren't being set automatically.

Any ideas?

Thanks,
Matt

********************************************************************************
This email may contain legally privileged information and is intended only for the addressee. It is not necessarily the official view or communication of the New Zealand Qualifications Authority. If you are not the intended recipient you must not use, disclose, copy or distribute this email or information in it. If you have received this email in error, please contact the sender immediately. NZQA does not accept any liability for changes made to this email or attachments after sending by NZQA.


All emails have been scanned for viruses and content by MailMarshal. NZQA reserves the right to monitor all email communications through its network.

********************************************************************************


------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to