Re: How to get submitting component in onError()?

2010-08-16 Thread Jeremy Thomerson
On Sun, Aug 15, 2010 at 5:24 PM, b...@actrix.gen.nz wrote:

 Hi James,

 Thank you very much for your reply.

 It didn't work because the form was submitted with input type=image,
 and I did not add an ImageButton for it.

 Things would be a little easier if there was an overridable onClick()
 method for submitting components not this Where was I type of back
 to front logic.


There's an onSubmit that you can override in Button.


 When using an ImageButton, one is forced to store the image as
 resource in the Java package structure which is another complication
 because web designers want to control such images in the web
 directory.


You can use other kinds of resources (that don't have to be packaged in the
src directory), you can relocate your resources, or you can use a regular
old Button or SubmitLink attached to a tag of your liking.

-- 
Jeremy Thomerson
http://www.wickettraining.com


How to get submitting component in onError()?

2010-08-15 Thread bht
Hi,

In a form with two submit buttons, a result must be calculated in
onError(), using the value of a FormComponent and depending on which
of the submit buttons was pressed.

I found that findSubmittingButton() and getDefaultButton() return null
in onError().

What to do?

Many thanks,

Bernard


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to get submitting component in onError()?

2010-08-15 Thread James Carman
From the looks of the code for findSubmittingButton(), it shouldn't
matter whether you're in onError() or onSubmit().  What does
findSubmittingButton() return in onSubmit()?

On Sun, Aug 15, 2010 at 6:59 AM,  b...@actrix.gen.nz wrote:
 Hi,

 In a form with two submit buttons, a result must be calculated in
 onError(), using the value of a FormComponent and depending on which
 of the submit buttons was pressed.

 I found that findSubmittingButton() and getDefaultButton() return null
 in onError().

 What to do?

 Many thanks,

 Bernard


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to get submitting component in onError()?

2010-08-15 Thread bht
Hi James,

Thank you very much for your reply.

It didn't work because the form was submitted with input type=image,
and I did not add an ImageButton for it.

Things would be a little easier if there was an overridable onClick()
method for submitting components not this Where was I type of back
to front logic.

When using an ImageButton, one is forced to store the image as
resource in the Java package structure which is another complication
because web designers want to control such images in the web
directory.

Many thanks,

Bernard


On Sun, 15 Aug 2010 10:47:58 -0400, you wrote:

From the looks of the code for findSubmittingButton(), it shouldn't
matter whether you're in onError() or onSubmit().  What does
findSubmittingButton() return in onSubmit()?

On Sun, Aug 15, 2010 at 6:59 AM,  b...@actrix.gen.nz wrote:
 Hi,

 In a form with two submit buttons, a result must be calculated in
 onError(), using the value of a FormComponent and depending on which
 of the submit buttons was pressed.

 I found that findSubmittingButton() and getDefaultButton() return null
 in onError().

 What to do?

 Many thanks,

 Bernard


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org