You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2014/11/14 19:06:25 UTC
RadioGroup not updating in ajax event
We have an ajax event initiated by one panel that affects the data, and needs
to force a redraw of a radiogroup in another panel. The ajax event arrives,
we add the radiogroup to the target, update the model that backs the
ListView, but the populateItem method never re-fires to redraw. Note that
this is in Wicket 1.4.7.
The following is the creation of the radio group.
group = new RadioGroup("roles", new Model<KeyValueBean>(getDefaultBean()));
group.setOutputMarkupId(true);
group.setRenderBodyOnly(false);
add(group);
appBean.setUmcOnlyRoles(umcOnlyRoles);
LoadableDetachableModel modelRoles = new LoadableDetachableModel() {
protected Object load() {
return appBean.getUmcOnlyRoles();
}
};
// add all roles
ListView<KeyValueBean> rolesList = new ListView<KeyValueBean>("radioList",
modelRoles){
protected void populateItem(final ListItem<KeyValueBean> item) {
final KeyValueBean bean = item.getModelObject();
@SuppressWarnings("rawtypes")
Radio radio = new Radio("radio", item.getModel()) {
//snipped for brevity
}
}
};
rolesList.setOutputMarkupId(true);
rolesList.setReuseItems(true);
group.add(rolesList);
In the ajax event we do this:
Panel app = (Panel)get("apps");
UMCApplicationPanel umc = (UMCApplicationPanel)app.get("umcPanel");
RadioGroup rolesMarkup = (RadioGroup)umc.get("roles");
//snipper for brevity
bean.setUmcOnlyRoles(umcOnlyRoles);
bean.seteShareChecked(eShareChecked);
target.addComponent(rolesMarkup);
The "bean" in this event is the same object as the "appBean" in the load
method of the detachable model in the constructor above. I can confirm that
the detachable model load fires and the right data is in it. Yet the
populateItem never runs...so the list is unchanged.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415.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: RadioGroup not updating in ajax event
Posted by Sven Meier <sv...@meiers.net>.
Hi,
please create a quickstart, then we will able to identify the problem.
Sven
On 11/17/2014 07:59 PM, Entropy wrote:
> Nobody has ideas?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415p4668438.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: RadioGroup not updating in ajax event
Posted by Entropy <bl...@gmail.com>.
Nobody has ideas?
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioGroup-not-updating-in-ajax-event-tp4668415p4668438.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