This was 'discussed' recently:

http://apache-wicket.1842946.n4.nabble.com/Overriding-Form-onFileUploadException-in-nested-forms-td4657874.html

I don't remember a Jira issue being created though.

Sven

On 05/15/2013 10:55 AM, Guillaume Mary wrote:
Hi all !

I have a nested form inside a root one, both are multipart. I want to cutomize 
the onFileUploadException(..) method of the nested form in order to trace this 
event. So I overrided the method of my nested form instance, typically to get a 
trace of file size limit exceeded.
But Wicket calls the onFileUploadException(..) on the root form, not on the 
nested one, so my overrided code doesn't apply.
I found that it's due to the AjaxformSubmitBehavior which calls 
onFormSubmitted(..) on the root form, here's the code :
protected void onEvent(final AjaxRequestTarget target)
{
                 getForm().getRootForm().onFormSubmitted(new 
IAfterFormSubmitter()
                 {
...

So I used my own behavior with the modified line (getRootForm() removed) :
getForm().onFormSubmitted(new IAfterFormSubmitter()

and it works : the onFileUploadException(..) of the nested form is called, not 
this of the root form.

I couldn't find another way to make it work, did I miss something ?

I think that Wicket should call onFileUploadException(..) on its nested forms 
so I think the actual behavior is a bug, am I wrong ? (I can fill in a bug if 
necessary)


I'm using Wicket 1.5.10.

Thanks !



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

Reply via email to