Enabling/disabling trigger - what is best practice

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

Enabling/disabling trigger - what is best practice

Hank Ratzesberger
Probably a basic XForms issue, but I don't understand
how to enable/disable a trigger.

For example, I want to page through a list, and disable
the Next and Prev buttons at the end/beginning.

The "Wizard with Switch" begins with a grayed Previous
button, but it is bound to an element with empty content
and it is not changed dynamically.

If I know I am at the end of my list, how do I gray a
Next button ?

(caveat, I'm editing this down and I don't know if valid)

<model>

 <instance id="control">
    <control xmlns="">
      <num-items>100</num-items>
      <start>1</start>
      <howmany>10</howmany>
    </control>
 </instance>

</model>

...............

<group ref="instance('control')">

  <trigger relevant="start &gt;= (howmany + 1)">
    <label>Prev</label>
    <action ev:event="DOMActivate">
      <setvalue ref="start" value="start - howmany"/>
      <!-- send a submit to update an instance... -->
    </action>
</trigger>

<trigger relevant="(start + howmany) &lt;= num-items">
  <label>Next</label>
  <action ev:event="DOMActivate">
    <setvalue ref="start" value="start + howmany"/>
    <!-- also send submit to update list instance -->
  </action>
</trigger>

</xforms:group>

Thanks for any tips,
Hank

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara
805.893.8042
805.893.8649 (fax)



--
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
Reply | Threaded
Open this post in threaded view
|

RE: Enabling/disabling trigger - what is best practice

Ryan Puddephatt
Hank,
        You need to use a xforms:bind for relevant, then bind the trigger to
the element controlled by the bind using @ref

Ryan

Ryan Puddephatt
Software Engineer

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108

 

>-----Original Message-----
>From: Hank Ratzesberger [mailto:[hidden email]]
>Sent: 30 November 2006 23:16
>To: [hidden email]
>Subject: [ops-users] Enabling/disabling trigger - what is best practice
>
>Probably a basic XForms issue, but I don't understand how to
>enable/disable a trigger.
>
>For example, I want to page through a list, and disable the
>Next and Prev buttons at the end/beginning.
>
>The "Wizard with Switch" begins with a grayed Previous button,
>but it is bound to an element with empty content and it is not
>changed dynamically.
>
>If I know I am at the end of my list, how do I gray a Next button ?
>
>(caveat, I'm editing this down and I don't know if valid)
>
><model>
>
> <instance id="control">
>    <control xmlns="">
>      <num-items>100</num-items>
>      <start>1</start>
>      <howmany>10</howmany>
>    </control>
> </instance>
>
></model>
>
>...............
>
><group ref="instance('control')">
>
>  <trigger relevant="start &gt;= (howmany + 1)">
>    <label>Prev</label>
>    <action ev:event="DOMActivate">
>      <setvalue ref="start" value="start - howmany"/>
>      <!-- send a submit to update an instance... -->
>    </action>
></trigger>
>
><trigger relevant="(start + howmany) &lt;= num-items">
>  <label>Next</label>
>  <action ev:event="DOMActivate">
>    <setvalue ref="start" value="start + howmany"/>
>    <!-- also send submit to update list instance -->
>  </action>
></trigger>
>
></xforms:group>
>
>Thanks for any tips,
>Hank
>
>Hank Ratzesberger
>NEES Programmer
>Institute for Crustal Studies
>University of California, Santa Barbara
>805.893.8042
>805.893.8649 (fax)
>
>



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Enabling/disabling trigger - what is best practice

Alessandro  Vernet
Administrator
In reply to this post by Hank Ratzesberger
Hank,

As mentioned by Ryan, you can use the <xforms:bind> 'relevant'
attribute if you want to hide the trigger. Use the 'readonly'
attribute if you just want to gray out the trigger.

Alex

On 11/30/06, Hank Ratzesberger <[hidden email]> wrote:

> Probably a basic XForms issue, but I don't understand
> how to enable/disable a trigger.
>
> For example, I want to page through a list, and disable
> the Next and Prev buttons at the end/beginning.
>
> The "Wizard with Switch" begins with a grayed Previous
> button, but it is bound to an element with empty content
> and it is not changed dynamically.
>
> If I know I am at the end of my list, how do I gray a
> Next button ?
>
> (caveat, I'm editing this down and I don't know if valid)
>
> <model>
>
>  <instance id="control">
>     <control xmlns="">
>       <num-items>100</num-items>
>       <start>1</start>
>       <howmany>10</howmany>
>     </control>
>  </instance>
>
> </model>
>
> ...............
>
> <group ref="instance('control')">
>
>   <trigger relevant="start &gt;= (howmany + 1)">
>     <label>Prev</label>
>     <action ev:event="DOMActivate">
>       <setvalue ref="start" value="start - howmany"/>
>       <!-- send a submit to update an instance... -->
>     </action>
> </trigger>
>
> <trigger relevant="(start + howmany) &lt;= num-items">
>   <label>Next</label>
>   <action ev:event="DOMActivate">
>     <setvalue ref="start" value="start + howmany"/>
>     <!-- also send submit to update list instance -->
>   </action>
> </trigger>
>
> </xforms:group>
>
> Thanks for any tips,
> Hank
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
> 805.893.8042
> 805.893.8649 (fax)
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Enabling/disabling trigger - what is best practice

rameshkancherla
Hi

      I am displaying trigger (edit buttons) in xforms:repeat. i want to hide the particular edit button like when user is not equal to admin.
i put a condition in bind tag with relevant attribute.after  i given this bind id to trigger. then i am getting all buttons to hide. but i want to hide particular button

how can i do it. can you please give me suggestion


Thanks & Regards
Ramesh k

Alessandro Vernet wrote
Hank,

As mentioned by Ryan, you can use the <xforms:bind> 'relevant'
attribute if you want to hide the trigger. Use the 'readonly'
attribute if you just want to gray out the trigger.

Alex

On 11/30/06, Hank Ratzesberger <hankr@crustal.ucsb.edu> wrote:
> Probably a basic XForms issue, but I don't understand
> how to enable/disable a trigger.
>
> For example, I want to page through a list, and disable
> the Next and Prev buttons at the end/beginning.
>
> The "Wizard with Switch" begins with a grayed Previous
> button, but it is bound to an element with empty content
> and it is not changed dynamically.
>
> If I know I am at the end of my list, how do I gray a
> Next button ?
>
> (caveat, I'm editing this down and I don't know if valid)
>
> <model>
>
>  <instance id="control">
>     <control xmlns="">
>       <num-items>100</num-items>
>       <start>1</start>
>       <howmany>10</howmany>
>     </control>
>  </instance>
>
> </model>
>
> ...............
>
> <group ref="instance('control')">
>
>   <trigger relevant="start &gt;= (howmany + 1)">
>     <label>Prev</label>
>     <action ev:event="DOMActivate">
>       <setvalue ref="start" value="start - howmany"/>
>      
>     </action>
> </trigger>
>
> <trigger relevant="(start + howmany) &lt;= num-items">
>   <label>Next</label>
>   <action ev:event="DOMActivate">
>     <setvalue ref="start" value="start + howmany"/>
>    
>   </action>
> </trigger>
>
> </xforms:group>
>
> Thanks for any tips,
> Hank
>
> Hank Ratzesberger
> NEES Programmer
> Institute for Crustal Studies
> University of California, Santa Barbara
> 805.893.8042
> 805.893.8649 (fax)
>
>
>
>
> --
> You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>


--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the ops-users@objectweb.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@objectweb.org
For general help: mailto:sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Enabling/disabling trigger - what is best practice

David McIntyre
If you use a ref on the trigger, rather than a bind, then you can use a predicate which depends on the current value of the repeat.

Cheers,

Dave

rameshkancherla wrote:
Hi

      I am displaying trigger (edit buttons) in xforms:repeat. i want to
hide the particular edit button like when user is not equal to admin. 
i put a condition in bind tag with relevant attribute.after  i given this
bind id to trigger. then i am getting all buttons to hide. but i want to
hide particular button

how can i do it. can you please give me suggestion


Thanks & Regards
Ramesh k


Alessandro  Vernet wrote:
  
Hank,

As mentioned by Ryan, you can use the <xforms:bind> 'relevant'
attribute if you want to hide the trigger. Use the 'readonly'
attribute if you just want to gray out the trigger.

Alex

On 11/30/06, Hank Ratzesberger [hidden email] wrote:
    
Probably a basic XForms issue, but I don't understand
how to enable/disable a trigger.

For example, I want to page through a list, and disable
the Next and Prev buttons at the end/beginning.

The "Wizard with Switch" begins with a grayed Previous
button, but it is bound to an element with empty content
and it is not changed dynamically.

If I know I am at the end of my list, how do I gray a
Next button ?

(caveat, I'm editing this down and I don't know if valid)

<model>

 <instance id="control">
    <control xmlns="">
      <num-items>100</num-items>
      <start>1</start>
      <howmany>10</howmany>
    </control>
 </instance>

</model>

...............

<group ref="instance('control')">

  <trigger relevant="start &gt;= (howmany + 1)">
    <label>Prev</label>
    <action ev:event="DOMActivate">
      <setvalue ref="start" value="start - howmany"/>
      <!-- send a submit to update an instance... -->
    </action>
</trigger>

<trigger relevant="(start + howmany) &lt;= num-items">
  <label>Next</label>
  <action ev:event="DOMActivate">
    <setvalue ref="start" value="start + howmany"/>
    <!-- also send submit to update list instance -->
  </action>
</trigger>

</xforms:group>

Thanks for any tips,
Hank

Hank Ratzesberger
NEES Programmer
Institute for Crustal Studies
University of California, Santa Barbara
805.893.8042
805.893.8649 (fax)




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



      
-- 
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



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


    

  

--
Orion Signature

Dave McIntyreSoftware Developer
[hidden email]
P: +64 9 638 0600
M: +64 21 123 456
F: +64 9 638 0699
S: <a href="callto:dave.mcintyre">dave.mcintyre
www.orionhealth.com


This e-mail and any attachments are intended only for the person to whom it is addressed and may contain privileged, proprietary, or other data protected from disclosure under applicable law. If you are not the addressee or the person responsible for delivering this to the addressee you are hereby notified that reading, copying or distributing this transmission is prohibited. If you have received this e-mail in error, please telephone us immediately and remove all copies of it from your system. Thank you for your co-operation.


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws