Could somebody give me an example of a form that has multiple submit
buttons? 

I've seen references to using the Wicket button class but when I try
this it doesn't seem to work.

public class CreatePage extends WebPage {

    public CreatePage() {
        super();

        add(new CreateForm("form"));
    }

    private static class CreateForm extends Form {

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

            add(new CancelButton("cancel"));
        }

        protected void onSubmit() {
            // What goes here?
        }

        private static class CancelButton extends Button {

            public CancelButton(String s) {
                super(s);
            }

            protected void onSubmit() {
                final RequestCycle cycle = getRequestCycle();

               
cycle.setResponsePage(getPageFactory().newPage(CancelPage.class));
                cycle.setRedirect(true);
            }
        }
    }
}

What am I doing wrong here...?

PS: I've searched the wiki and the archive of mail messages without
much success.

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.

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


-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to