You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Neil Curzon <ne...@gmail.com> on 2011/06/06 21:43:17 UTC

OnChange Ajax inside form within form?

Hi users!

Using wicket 1.4.17. I have a relatively large form. Inside this form,
there's going to be a readonly text field that is actually populated by
using a popup dialog, which opens a div with an ajax interface to navigate
some entities in our system.

The thing is, inside the entity navigation form, there are drown down
choices (selects) which need to refresh other drop down choices via ajax.
The way I know how to do this is by using an AjaxFormSubmitBehavior on the
drop down choices. The thing is, that this entity navigation form starts out
invisible, becomes visible when clicking on an AjaxLink, and both Chrome and
Firefox just don't put the form tag into the dom (despite it appearing in
the wicket debug panel). I guess this is because html doesn't allow nested
forms. So everything works up to the point where the AjaxFormSubmitBehavior
on the selects fails to submit the form because the generated JS in the
onchange handler in the selects looks for a form ID that doesn't exist (the
navigation widget's form id, the form that wasn't actually put in the dom).

Any ideas for how to make something like this work?

Thanks
Neil

Re: OnChange Ajax inside form within form?

Posted by Neil Curzon <ne...@gmail.com>.
Hi Pedro,

Thanks for the reply. Actually I figured out the issue was that the outer
form wasn't "wicketized" yet, so wicket couldn't figure it out (converting
legacy pages). AjaxFormSubmitBehavior still worked in my case.

Neil

On Mon, Jun 6, 2011 at 4:17 PM, Pedro Santos <pe...@gmail.com> wrote:

> Hi Neil, already Wicket prevents nested form tag by changing inner
> form tag by div one. I guess you need to change the
> AjaxFormSubmitBehavior to AjaxFormComponentUpdatingBehavior to handle
> the "onchange" event.
>
> On Mon, Jun 6, 2011 at 4:43 PM, Neil Curzon <ne...@gmail.com> wrote:
> > Hi users!
> >
> > Using wicket 1.4.17. I have a relatively large form. Inside this form,
> > there's going to be a readonly text field that is actually populated by
> > using a popup dialog, which opens a div with an ajax interface to
> navigate
> > some entities in our system.
> >
> > The thing is, inside the entity navigation form, there are drown down
> > choices (selects) which need to refresh other drop down choices via ajax.
> > The way I know how to do this is by using an AjaxFormSubmitBehavior on
> the
> > drop down choices. The thing is, that this entity navigation form starts
> out
> > invisible, becomes visible when clicking on an AjaxLink, and both Chrome
> and
> > Firefox just don't put the form tag into the dom (despite it appearing in
> > the wicket debug panel). I guess this is because html doesn't allow
> nested
> > forms. So everything works up to the point where the
> AjaxFormSubmitBehavior
> > on the selects fails to submit the form because the generated JS in the
> > onchange handler in the selects looks for a form ID that doesn't exist
> (the
> > navigation widget's form id, the form that wasn't actually put in the
> dom).
> >
> > Any ideas for how to make something like this work?
> >
> > Thanks
> > Neil
> >
>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: OnChange Ajax inside form within form?

Posted by Pedro Santos <pe...@gmail.com>.
Hi Neil, already Wicket prevents nested form tag by changing inner
form tag by div one. I guess you need to change the
AjaxFormSubmitBehavior to AjaxFormComponentUpdatingBehavior to handle
the "onchange" event.

On Mon, Jun 6, 2011 at 4:43 PM, Neil Curzon <ne...@gmail.com> wrote:
> Hi users!
>
> Using wicket 1.4.17. I have a relatively large form. Inside this form,
> there's going to be a readonly text field that is actually populated by
> using a popup dialog, which opens a div with an ajax interface to navigate
> some entities in our system.
>
> The thing is, inside the entity navigation form, there are drown down
> choices (selects) which need to refresh other drop down choices via ajax.
> The way I know how to do this is by using an AjaxFormSubmitBehavior on the
> drop down choices. The thing is, that this entity navigation form starts out
> invisible, becomes visible when clicking on an AjaxLink, and both Chrome and
> Firefox just don't put the form tag into the dom (despite it appearing in
> the wicket debug panel). I guess this is because html doesn't allow nested
> forms. So everything works up to the point where the AjaxFormSubmitBehavior
> on the selects fails to submit the form because the generated JS in the
> onchange handler in the selects looks for a form ID that doesn't exist (the
> navigation widget's form id, the form that wasn't actually put in the dom).
>
> Any ideas for how to make something like this work?
>
> Thanks
> Neil
>



-- 
Pedro Henrique Oliveira dos Santos

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