If I understand your problem correctly, you could override the
newLink() method of the AjaxTabbedPanel to return an AjaxSubmitLink
instead. Something like the following:

tabPanel = new AjaxTabbedPanel("tabs", tabs){
@Override
protected WebMarkupContainer newLink(String linkId, final int index) {
        return new AjaxSubmitLink(linkId, yourForm) {
                @Override
                protected void onSubmit(AjaxRequestTarget target, Form form) {
                        setSelectedTab(index);
                        if (target != null) {
                                target.addComponent(tabPanel);
                        }
                        onAjaxUpdate(target);
                }
                
                @Override
                protected void onError(AjaxRequestTarget target, Form form){
                        AjaxUtils.error(form);
                }
        };
}
};


Disclaimer: the code above is based on Wicket 1.2.6.


Cheers,

Fabio Fioretti - WindoM


On Jan 17, 2008 1:21 PM, Steffen Fritzsche <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have the following problem. I created a three individual forms each
> within its own Tab (implementing AbstractTab). Each is submitted via
> ajax according to the Ajax-FormPage example. All forms are backed by the
> same Model-Object representing a simple Product wrapped in a
> BoundCompoundPropertyModel.
>
> On the surrounding page I have a forth form just with a submit button.
> This form refers to the same Product-Object and when the button is
> clicked it performs some action cleans up my Product Object and persists
> it via JPA.
>
> This is working so far, but currently I have to hit my "ajax-submit"
> button always before switching between each of the three "real" forms
> using the tabs.
>
> Is there an elagant solution to trigger this ajax submit and validating
> the form elements of the currently active form when the user clicks on
> one of the other form-tabs. So that I do not need a visible ajax-submit
> button anymore ...
>
> Steffen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to