java - Wicket: Update Model on DropDownChoice Item Selection Event -
i need update model or object after select dropdownchoice item.
bellow code i'm working:
add(new listview[company]("listcompanies", listdata) { override protected def onbeforerender() { // // ... super.onbeforerender() } def populateitem(item: listitem[company]) = { var company = item.getmodelobject() //... val listclients: java.util.list[client] = clientcontroler.listclients item.add(new dropdownchoice("clientselection", listclients,new choicerenderer[client]("name")))
in listview properties of company object, after choose name property of dropdownchoice, model company updated client name selected.
how can achieve this?
thanks
i think can override onselectionchanged. need override wantonselectionchangednotifications return true make work. this.
dropdownchoice<client> dropdownchoice = new dropdownchoice("clientselection", listclients) { @override protected boolean wantonselectionchangednotifications() { return true; } @override protected void onselectionchanged(object newselection) { // here when selection changed } };
Comments
Post a Comment