sorry , it's mentioned in the java doc that the onSubmit method of the parent
form won't be called. my mistake i didn't notice that.




----- Original Message ----- From: "Phil Kulak" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, September 14, 2005 3:03 PM
Subject: Re: [Wicket-user] setDefaultFormProcessing()


Currently if a button is found, it's onSubmit is called instead of the
form's. Why would you want to take the button's logic out of the
button?

On 9/14/05, Dipu <[EMAIL PROTECTED]> wrote:

I am using the wicket version 1.1-b4,
when setDefaultFormProcessing() is set to false, the form is not getting
submitted.

I have a form with the following code.

Button backButton = new Button("backButton")
backButton.setDefaultFormProcessing(false);
add(backButton);


public void onSubmit()
{
    Button button = findSubmittingButton();
    if(button.getId().equals("backButton"))
   {
       //go back
   }
   else
   {
       // do something
   }
}

how ever if i change the code like the following - it works

Button backButton = new Button("backButton")
  {
   protected void onSubmit()
   {
     //go back
   }
  } ;
  backButton.setDefaultFormProcessing(false);
  add(backButton);


Can't i have multiple buttons in a form and a common onSubmit method.
Or should i be following the second approach when i want to bypass the the
validation and do a submit.


Regards
Dipu





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to