java - Wicket: Using a editable Inline-label inside a ListView and update a model after change this label value -
i need use editable label or inline-label in listview , after change value of component want know how can update property of object displayed in listview
add(new listview[someobject]("listsomeobject", listdata) { override protected def onbeforerender() { ... super.onbeforerender() } def populateitem(item: listitem[someobject]) = { var objvalue = item.getmodelobject() item.add(new label("total", objvalue.tostring(getformatter()))) } } })
in code above, object someobject has property called total, listview shows set of someobject, when label total changed in line of listview corresponding object someobject should updated new value of label total.
someone can provide useful example me task?
thanks
you should use model display property. example propertymodel. method getobject()
called on display. propertymodel call getter selected property. can have object have getter retrieves formatted value interested in.
item.add(new label("total", new propertymodel(item.getmodel(), "formattedvalue")))
Comments
Post a Comment