ZK: enable button in listcell only for the selected item of a listbox -
in next listbox load elements template:
<listbox model="@load(vm.resaccepted)" selecteditem="@bind(vm.selresaccepted)"> <template name="model"> <listitem> <listcell label="@load(each.eventname)" /> <listcell label="@load(each.username)" /> <listcell> <button image="/img/button_mail.png"/> </listcell> </listitem> </template> </listbox>
my goal enable button of listitem only row user selects.
to this, try
<button disabled="@load(vm.selresaccepted.id=each.id?'false':'true')" />
checking if unique field id same of selected element, fails.
any appreciated.
you can use eq
equals comparison:
<button disabled="@load(vm.selresaccepted.id eq each.id?'false':'true')" />
or maybe better: disabled when selected item not current item
<button disabled="@load(vm.selresaccepted ne each)" />
here ne
not equal
Comments
Post a Comment