-
FEATURED COMPONENTS
First time here? Check out the FAQ!
There is a button whith
onClick="@command('blah')"
As for now I found this solution:
onClick="@command('showGroupsDialog', params=self.getId())"
@Command public void showGroupsDialog(@BindingParam("params") String params)
You can't, if you recall the other topic I created, you can't use EL inside @command. That's why first I assign EL expression to the ID, and then pass self.getId() to the @command. This is the only workaround I've found.
A little bit later than I thought, but I was successful using the following construct:
<listbox ...> <listhead sizable="true"> ... </listhead> <template name="model" var="sec"> <listitem> <listcell> <checkbox checked="@load(sec.active)" onCheck="@command('toggleActive', sec=sec)"/> </listcell> ...
@Command public void toggleActive(@BindingParam("sec") Sec sec) {
The listbox model is a List<Sec>. It's the object that represents a row.
In this example, the object has an "active" property which can be enabled/disabled using a checkbox in the first column.
To operate on the correct object the toggleActive command needs the correct Sec object.
The central part is the "sec=sec" parameter in the @command definition. Left hand is the binding parameter, right hand is a ZK bind expression and is evaluated to the underlying business object.
Asked: 2011-12-21 10:16:58 +0800
Seen: 298 times
Last updated: Jan 04 '12