You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Kröger <kr...@disy.net> on 2007/10/29 17:49:21 UTC

EqualInputValidator inside WizardStep

Hi,

I need to check two TextFields for equality within a WizardStep, so i added
an EqualInputValidator to the Wizard's form inside the onBeforeRender()
method of the WizardStep:

protected void onBeforeRender() {
  super.onBeforeRender();

  final Form form = ((Wizard) getModelObject()).getForm();
  form.add(new EqualInputValidator(emailField, emailConfirmationField));
}

I think this was the wrong approach because now every other WizardStep is
complaining:

"IFormValidator in form `orderWizard:form` depends on a component that has
been removed from the page or is no longer visible. Offending component id
`order.customer.email`."

What is the right way to use an EqualInputValidator inside a WizardStep?

Thanks in advance for your help!

Best regards
Daniel


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


Re: EqualInputValidator inside WizardStep

Posted by Eelco Hillenius <ee...@gmail.com>.
On 10/29/07, Igor Vaynberg <ig...@gmail.com> wrote:
> hrm, i think a good solution to this would be to create a fresh inner
> form for every new step. so the outer form contains the wizard
> buttons, and an inner form contains the user's panel.
>
> i think for now you can do that yourself, simply embed a form into
> your step's panel and add the validator to that, be sure to let us
> know if that works.
>
> eelco what do you think?

That's not a bad idea. You could also directly get the form by calling
getForm or by overriding newForm on the wizard class. But nested forms
like this has it's elegance... just never though of it before.

Eelco

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


Re: EqualInputValidator inside WizardStep

Posted by Daniel Kröger <kr...@disy.net>.
Adding the validator to an embedded form worked! Thanks for your help, Igor!

Daniel

 

> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
> Sent: Monday, October 29, 2007 6:01 PM
> To: users@wicket.apache.org
> Subject: Re: EqualInputValidator inside WizardStep
> 
> hrm, i think a good solution to this would be to create a fresh inner
> form for every new step. so the outer form contains the wizard
> buttons, and an inner form contains the user's panel.
> 
> i think for now you can do that yourself, simply embed a form into
> your step's panel and add the validator to that, be sure to let us
> know if that works.
> 
> eelco what do you think?
> 
> -igor
> 
> 
> On 10/29/07, Daniel Kröger <kr...@disy.net> wrote:
> > Hi,
> >
> > I need to check two TextFields for equality within a 
> WizardStep, so i added
> > an EqualInputValidator to the Wizard's form inside the 
> onBeforeRender()
> > method of the WizardStep:
> >
> > protected void onBeforeRender() {
> >   super.onBeforeRender();
> >
> >   final Form form = ((Wizard) getModelObject()).getForm();
> >   form.add(new EqualInputValidator(emailField, 
> emailConfirmationField));
> > }
> >
> > I think this was the wrong approach because now every other 
> WizardStep is
> > complaining:
> >
> > "IFormValidator in form `orderWizard:form` depends on a 
> component that has
> > been removed from the page or is no longer visible. 
> Offending component id
> > `order.customer.email`."
> >
> > What is the right way to use an EqualInputValidator inside 
> a WizardStep?
> >
> > Thanks in advance for your help!
> >
> > Best regards
> > Daniel
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 


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


Re: EqualInputValidator inside WizardStep

Posted by Igor Vaynberg <ig...@gmail.com>.
hrm, i think a good solution to this would be to create a fresh inner
form for every new step. so the outer form contains the wizard
buttons, and an inner form contains the user's panel.

i think for now you can do that yourself, simply embed a form into
your step's panel and add the validator to that, be sure to let us
know if that works.

eelco what do you think?

-igor


On 10/29/07, Daniel Kröger <kr...@disy.net> wrote:
> Hi,
>
> I need to check two TextFields for equality within a WizardStep, so i added
> an EqualInputValidator to the Wizard's form inside the onBeforeRender()
> method of the WizardStep:
>
> protected void onBeforeRender() {
>   super.onBeforeRender();
>
>   final Form form = ((Wizard) getModelObject()).getForm();
>   form.add(new EqualInputValidator(emailField, emailConfirmationField));
> }
>
> I think this was the wrong approach because now every other WizardStep is
> complaining:
>
> "IFormValidator in form `orderWizard:form` depends on a component that has
> been removed from the page or is no longer visible. Offending component id
> `order.customer.email`."
>
> What is the right way to use an EqualInputValidator inside a WizardStep?
>
> Thanks in advance for your help!
>
> Best regards
> Daniel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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