Refresh data in Wicket DataView -
i have dropdownchoice , dataview @ page. dataview should show data according item selected in dropdownchoice. how can achieve this?
thanks propertymodel can change text of label in pretty simple way. there som way dataview? not looking ajax refresh. lot in advance
your dataview
uses dataprovider
values show. if add dataview
(or parent) ajaxrequesttarget
refetch values dataprovider
. need make sure changing selection in dropdownchoice
update dataprovider
.
e.g.
dropdown.add(new ajaxformcomponentupdatingbehavior("onchange") { @override protected void onupdate(ajaxrequesttarget target) { dataprovider.setselecteditem(dropdownmodel.getobject()); target.add(dataview); //o dataview's parent } });
update
mydataprovider { private someobject selecteditem; @override public iterator<? extends someotherobject> iterator(long first, long count) { return this.service.findallforitem(this.selecteditem).iterator(); } //+size + setter selecteditem }
Comments
Post a Comment