سؤال

I would like to apply style class on conditional basis.

Lets say i have xforms:trigger button, i want to make this button readonly (disabled) when the read only flag is true.

<xforms:trigger appearance="minimal" class="xforms-readonly">

The clause class="xforms-readonly" i want to apply it conditionally.

Please suggest a way to do so.

هل كانت مفيدة؟

المحلول

The standards-compatible way would be this:

<xforms:model>
  ...
  <xforms:bind nodeset="instance('data')/read-only" readonly=". = 'true'"/>
</xforms:model>
...
<xforms:trigger ref="instance('data')/read-only" appearance="minimal">
  ...
</xforms:trigger>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top