Brucevilla
Brucevilla

Reputation: 156

ZK Component Set Component Not Value

It seems very simple and maybe silly. But I couldn't find a way to set reverse of the combobox disabled value into the a(id=add) visibility.

<combobox id="cb" model="@{cont.values}" autodrop="true" disabled="true" readonly="false" >
    <comboitem self="@{each=val}"  label="@{val.name}" />
</combobox>
<a id="add" iconSclass="icon-plus-sign" visible="${cb.disabled}"/>

How to make this? The above form in my solution makes the exact opposite what I want.

Upvotes: 1

Views: 335

Answers (1)

kachhalimbu
kachhalimbu

Reputation: 2200

Use EL expression NOT operator

visible="${not cb.disabled}"

Refer here for more details about EL expression operators within ZUML

Update: Here is a working sample

<zk>
    <combobox id="cb" disabled="true" readonly="false" >
       <comboitem label="Test 1" />
       <comboitem label="Test 2" />
       <comboitem label="Test 3" />
    </combobox>
    <a id="add" visible="${not cb.disabled}">Add</a>
</zk>

Upvotes: 1

Related Questions