You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2012/08/22 17:44:09 UTC

Ajax onUpdate (DropDown) Invoked In One Place, But Not The Other

I have a reusable Panel which contains a DropDownChoice.

The DropDownChoice has an Ajax onChange action defined on it,

protected void onUpdate(AjaxRequestTarget target) {
...
}

When I add the Panel to one of my forms, the Ajax action gets invoked
correctly on the DropDown change, but when I add it to a different form, the
Ajax action never gets invoked. It's the same reusable Panel. The Ajax
action works in one place, but not the other (I verified that nothing
happens by adding debug statements to onUpdate).

Can anyone suggest any theories on what the problem might be with the 2nd
form that uses this panel? Thanks



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-onUpdate-DropDown-Invoked-In-One-Place-But-Not-The-Other-tp4651438.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Ajax onUpdate (DropDown) Invoked In One Place, But Not The Other

Posted by eugenebalt <eu...@yahoo.com>.
Thanks



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-onUpdate-DropDown-Invoked-In-One-Place-But-Not-The-Other-tp4651438p4651442.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Ajax onUpdate (DropDown) Invoked In One Place, But Not The Other

Posted by Sven Meier <sv...@meiers.net>.
Yes, this is the problem.

Only one of the two updates will be performed:

https://issues.apache.org/jira/browse/WICKET-214

Sven

On 08/22/2012 06:51 PM, eugenebalt wrote:
> Looking further in our code, I see that the 2nd form (which has the problem)
> defines an additional Ajax "onchange" on its own, it finds the dropdown and
> adds this extra Ajax code:
>
> final DropDownChoice myDropDown =
> (DropDownChoice)((Panel)get("myPanel")).get("myDropDown");
> myDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
>              protected void onUpdate(AjaxRequestTarget target)
>                 ...
>              }
> });
>
>
> Is this an issue? Is there a problem getting *both* Ajax updates to kick in,
> both the Form2-specific one and the general Panel one? Thanks
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-onUpdate-DropDown-Invoked-In-One-Place-But-Not-The-Other-tp4651438p4651439.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Ajax onUpdate (DropDown) Invoked In One Place, But Not The Other

Posted by eugenebalt <eu...@yahoo.com>.
Looking further in our code, I see that the 2nd form (which has the problem)
defines an additional Ajax "onchange" on its own, it finds the dropdown and
adds this extra Ajax code:

final DropDownChoice myDropDown =
(DropDownChoice)((Panel)get("myPanel")).get("myDropDown");
myDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            protected void onUpdate(AjaxRequestTarget target) 
               ...
            }
});


Is this an issue? Is there a problem getting *both* Ajax updates to kick in,
both the Form2-specific one and the general Panel one? Thanks



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ajax-onUpdate-DropDown-Invoked-In-One-Place-But-Not-The-Other-tp4651438p4651439.html
Sent from the Users forum mailing list archive at Nabble.com.

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