/
/
/
Disable the button depending on the value

Disable the button depending on the value

In case we need to make a button available or disable it based on the value of a certain field in the list, Let's consider describing the buttons of an arbitrary list:

  <metadata name="list" type="list" key="id">
    <toolbar>
      <toolbtn func="list.new" type="new" img="t-new" name="newelem" default="yes"/>
      <toolbtn func="list.hide" type="new" img="t-lock" name="hideelem">
        <show name="active" value="on"/>
      </toolbtn>
      <toolbtn func="list.show" type="new" img="t-lock" name="showelem">
        <hide name="active" value="on"/>
      </toolbtn>
    </toolbar>
    ...
  </metadata>

In this example, the showelem button will appear active for list items with the active column set to off. And hideelem for those with the value on.