Btw, typically you get the form from the Wizard (getForm). But
obviously, it has to be created before that gives anything other than
null :-)

Eelco

On 1/5/08, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> Yeah, the form is initialized in the Wizard's init method, not right
> away during construction. You could try patching the wizard and
> creating the form in the constructor instead and see if that solves
> your problem and propose a patch if it does. I wouldn't mind having
> another wizard example in wicket-examples either, so if you want, you
> can make a little test app that plugs in wicket-examples for this :-)
>
> Eelco
>
> On 1/5/08, Paolo Di Tommaso <[EMAIL PROTECTED]> wrote:
> > Let me guess .. you need the form to create a AjaxSubmitLink instance.
> >
> > But the #findParent(Form.class) will return null until the component
> > hierarchy is constructed, being so you cannot invoke it at component
> > construction-time.
> >
> > A possible workaround is to postpone the findParent(Form.class) method
> > invocation instantiating a the AjaxSubmitLink using a form proxy.
> >
> > I've hacked this writing a custom AjaxFormSubmitBehavior that does not
> > require the form instance on its constructor but just discover it - invoking
> > #findParent(Form.class) method - when is required.
> >
> > Me fate sempre lavora.. ;)
> >
> > P
> >
> >
> > On Jan 4, 2008 12:43 PM, Fabio Fioretti <[EMAIL PROTECTED]> wrote:
> >
> > > First of all, many compliments for the great Wicket 1.3 release: we're
> > > looking forward to port our application to the new cool version!
> > >
> > > How can I get the Wizard's form from inside a WizardStep? I need it to
> > > trigger an AjaxSubmitLink which should update a part of my model while
> > > remaining inside that step. What leaves me clueless is the fact that
> > > WizardStep instances are added to the WizardModel instead of the
> > > Wizard, so doing something like this from inside the WizardStep:
> > >
> > > Form form = (Form)WizardStep.this.findParent(Form.class);
> > >
> > > seems to return null; moreover, this makes me wonder how the same
> > > instruction inside WizardStep.AddFormValidatorAction.execute() can
> > > succeed.
> > >
> > > I'm sure I'm missing something really stupid. Please forgive me. :-)
> > >
> > >
> > > Thanks a lot,
> > >
> > > Fabio Fioretti - WindoM
> > >
> > > ---------------------------------------------------------------------
> > > 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