Re: How to disable a trigger

Greetings  Catherine, you are correct that use of @relevant will help you 
achieve what you want.

You will need to add some instance data, either in the instance that you 
already have or create another instance.

<instance id="second_one">
        <capabilities>
                <edit>y</edit>
                <delete>n</delete>
        </capabilities>
</instance>

<bind id="ed" nodeset="instance('i2')/capabilities/edit" 
relevant="instance('i2')/capabilities/edit &eq; y" />
<bind id="de" nodeset="instance('i2')/capabilities/delete" 
relevant="instance('i2')/capabilities/delete &eq; y" />

and then change your triggers to refer to these elements

                <xforms:trigger bind="ed" class="nvi-link-style 
nvP12_wsrp_rewrite_">
                <xforms:trigger bind="de" class="nvi-link-style 
nvP12_wsrp_rewrite_">

I do not know how you will determine if the user is to have the triggers 
enabled but whatever the constraint is it will need to be expressed in the 
relevant attribute.

Regards, Roland



"Catherine Poinsignon" <catherine.poinsignon@lombard.lu> 
Sent by: www-forms-request@w3.org
21/01/2005 14:30

To
<www-forms@w3.org>
cc

Subject
How to disable a trigger






Hello,
 
I want to disable a trigger for some user. I have a list of items, 
following by 3 triggers : view, edit, delete. Everybody should view the 
details but only some user should update or delete. So I would like to 
diable these triggers, i.e. make them not relevant.
I think I have to use the relevant property from a bind element, but I did 
not know how.
Could you please help me ?
 
Here is my suff :
 
<xforms:model id="model_wsrp_rewrite_" 
schema="resource/schema/schemadt.xsd">
            <xforms:instance id="data_wsrp_rewrite_"
                nweb:pageflow-replace-data="always" 
nweb:primary-input-data="true">
                <data xmlns="">
                    <record>
                        <projectname>samplevalue</projectname>
                        <id>samplevalue</id>
                        <projectmanager>sample</projectmanager>
                    </record>
            </xforms:instance>
             <xforms:submission action="?verb=view"
                id="sView_wsrp_rewrite_" method="post"
                model="model_wsrp_rewrite_" 
ref="instance('submit_wsrp_rewrite_')"/>
            <xforms:submission action="?verb=edit"
                id="sEdit_wsrp_rewrite_" method="post"
                model="model_wsrp_rewrite_" 
ref="instance('submit_wsrp_rewrite_')"/>
              <xforms:submission action="?verb=delete"
                id="sDelete_wsrp_rewrite_" method="post"
                model="model_wsrp_rewrite_" 
ref="instance('submit_wsrp_rewrite_')"/>
        </xforms:model>
...
...
                <xforms:trigger class="nvi-link-style 
nvP11_wsrp_rewrite_">
                    <xforms:label>View</xforms:label>
                    <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue
 ref="instance('submit_wsrp_rewrite_')/query/id" 
value="instance('data_wsrp_rewrite_')/record[index('record_wsrp_rewrite_')]/id/@key"/>
                        <xforms:send submission="sView_wsrp_rewrite_"/>
                    </xforms:action>
                </xforms:trigger>
                <xforms:trigger class="nvi-link-style 
nvP12_wsrp_rewrite_">
                    <xforms:label>Edit</xforms:label>
                    <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue
 ref="instance('submit_wsrp_rewrite_')/query/id" 
value="instance('data_wsrp_rewrite_')/record[index('record_wsrp_rewrite_')]/id/@key"/>
                        <xforms:send submission="sEdit_wsrp_rewrite_"/>
                    </xforms:action>
                </xforms:trigger>
                <xforms:trigger class="nvi-link-style 
nvP13_wsrp_rewrite_">
                    <xforms:label>Delete</xforms:label>
                    <xforms:action ev:event="DOMActivate">
                        <xforms:setvalue
 ref="instance('submit_wsrp_rewrite_')/query/id" 
value="instance('data_wsrp_rewrite_')/record[index('record_wsrp_rewrite_')]/id/@key"/>
                        <xforms:send submission="sDelete_wsrp_rewrite_"/>
                    </xforms:action>
                </xforms:trigger>

Received on Friday, 21 January 2005 17:03:32 UTC