Hi folks, 

I've been fiddling around with JCaptcha, Wicket and Spring these days. Now
I'm trying to decouple the captcha part of the GUI from the rest. I.e. I'm
trying to construct a captcha-component that can easily be nested into a
form (into any form basically).
The captcha class should look something like that

public abstract class CaptchaPanel extends Panel {
    ....

    public CaptchaPanel() {
        Form form;
        add(form = new Form("captchaForm") {
              protected void onSubmit() {
                  // do the captcha validation stuff

                  // call on error if the entered tet
                  Captcha.this.onError();
              }
        });
        // add the components
        form.add(new RequiredTextField("captchaInput" .... );
        form.add(new Image(........));
    }
    
    protected abstract void onError();
}

I know from the wicket 1.3 API that forms can be nested and I also know that
each form has to be submitted separately. 
My problem therefore is that the captcha-form's onSubmit button doesn't get
called if someone submits the outside form (= the form the component is
nested in). Is there a possibility to submit the 'inner' form as well when
the 'outer' form is submitted? I'm also open for other suggestions, maybe
there's already a Wicket best-practise solution, which would be nice :-)

I'm kinda stuck, it's late at night and I really hope someone is able to
give me a hint.

Thanks in advance

Michael
-- 
View this message in context: 
http://www.nabble.com/Decouple-parts-of-a-form-tf4591493.html#a13107429
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to