Additional ajax request before ajax form submit

2013-09-27 Thread Tom Götz
Hi,

I have the following situation:
we use a tabpanel (8-10 tabs) to display lots of form components. On tab change 
the content of the activated tab is made visible via ajax, content of all other 
tabs is made invisible (setVisible(false)). To not lose user input we do a form 
submit when changing tabs, with setDefaultFormProcessing(false). All fine up to 
here.

Now: when I submit the form, only the data of the active tab is submitted, 
because all others are invisible at that moment. So I think I need to do an 
additional ajax request before submitting the form, to set all tab-content 
visible and after that submit the form. Does this sound like a good idea? How 
would I do that?

Cheers,
   -Tom



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



Re: Additional ajax request before ajax form submit

2013-09-27 Thread Ernesto Reinaldo Barreiro
I think that if your are using AJAXTabbedPanel only one tab will be present
at client side at any time: as far as I remember the component does an AJAX
replace when you choose tabs. One alternative would be using a tabs
components that displays all tabs on client and uses JavaScript to make
them visible/invisible.


On Fri, Sep 27, 2013 at 10:41 AM, Tom Götz t...@decoded.de wrote:

 Hi,

 I have the following situation:
 we use a tabpanel (8-10 tabs) to display lots of form components. On tab
 change the content of the activated tab is made visible via ajax, content
 of all other tabs is made invisible (setVisible(false)). To not lose user
 input we do a form submit when changing tabs, with
 setDefaultFormProcessing(false). All fine up to here.

 Now: when I submit the form, only the data of the active tab is submitted,
 because all others are invisible at that moment. So I think I need to do an
 additional ajax request before submitting the form, to set all tab-content
 visible and after that submit the form. Does this sound like a good idea?
 How would I do that?

 Cheers,
-Tom



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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: Additional ajax request before ajax form submit

2013-09-27 Thread Martin Grigorov
Hi,


On Fri, Sep 27, 2013 at 10:41 AM, Tom Götz t...@decoded.de wrote:

 Hi,

 I have the following situation:
 we use a tabpanel (8-10 tabs) to display lots of form components. On tab
 change the content of the activated tab is made visible via ajax, content
 of all other tabs is made invisible (setVisible(false)). To not lose user
 input we do a form submit when changing tabs, with
 setDefaultFormProcessing(false). All fine up to here.

 Now: when I submit the form, only the data of the active tab is submitted,
 because all others are invisible at that moment. So I think I need to do an
 additional ajax request


But the data of the invisible ones is already at the server.
It has been uploaded when you switched to the new tab.

I guess you want to validate all form component at the end.
But with your current approach the data is already in the models, without
validation.

One way is to render all form component and use client side tabbed panel
that doesn't use display:none to hide the inactive tabs because this way
the browser won't submit their data.

Another way is to do some custom validation on the model data in
Form#onSubmit() before saving the data in the DB.


 before submitting the form, to set all tab-content visible and after that
 submit the form. Does this sound like a good idea? How would I do that?

 Cheers,
-Tom



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