Hide a trigger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hide a trigger

ChrisSpeare
Is there anyway to make a trigger not visible - not not enabled, plain not there.  I know if you use ref='..' you can bind it to be visible when an element is there, but I want it to be invisble when I want. Reason being I have add / remove buttons and only want the add to show when there is no element, and remove to show when is the element there.
Reply | Threaded
Open this post in threaded view
|

Re: Hide a trigger

fl.schmitt(ops-users)
Hi Chris,

> Is there anyway to make a trigger not visible - not not enabled, plain not
> there.  I know if you use ref='..' you can bind it to be visible when an
> element is there, but I want it to be invisble when I want.  Reason being I
> have add / remove buttons and only want the add to show when there is no
> element, and remove to show when is the element there.

you can use an arbitrary xpath expression as condition for the ref when
using it as predicate. I have similar cases where i put a simple
calculation in the ref attribute:

<xforms:trigger ref=".[count(metadaten/norm) &lt; 1]">>
     <xforms:label>add</xforms:label>
     <xforms:insert ev:event="DOMActivate" context="metadaten" ... />
</xforms:trigger>

If there's no element metadaten/norm, then the add trigger is displayed,
else not. The remove trigger needs the contrary xpath calculation. Using
this syntax, you're quite flexible with displaying or hiding controls.


HTH
florian





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws