Trigger in repeat in group

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

Trigger in repeat in group

npujol73

Hi,

 I am not sure if this by design or a bug but why is it that the nodeset arg of
an xforms:insert seems
to ignore the context established by a surrounding a group ? I have to refer to
make the nodeset absolute to the instance doc not relative, I also tried the
xforms 1.1 context function . No luck. Any suggestions? Thanks!

<xforms:group ref="section[@id='FORM_OA_ADDRESS_PHONE']>
   <xforms:trigger>
          <xforms:action ev:event="DOMActivate">
         
                   <!-- this works but is 'absolute'-->
                  <xforms:insert
nodeset="instance('fr-metadata')/section[@id='FORM_OA_ADDRESS_PHONE']/item"
at="last()" position="after"></xforms:insert>
   
                    <!-- this does not work -this is relative to the group
above -->
                       <xforms:insert nodeset="item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

          <!-- the xforms 1.1 context()  does not work either -->
                       <xforms:insert nodeset="context()/item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

           </xforms:action>
   </xforms:trigger>
  <xforms:repeat id="repeat-FORM_OA_ADDRESS_PHONE" nodeset="item">    
   ....
  </xforms:repeat>  
<xforms:group>


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

Re: Trigger in repeat in group

Philip.Cantin
Nicolas,

Have a look at this link here:

http://wiki.orbeon.com/forms/how-to/repeat-insert-position


Notice how you use the 'context' attribute of <xforms:insert> to establish the context of where you want to add the node, and the 'origin' attribute to establish what node you would like to add.

Also, within an <xforms:group>, the context attribute of an <xforms:insert> statement will be relative to the ref attribute of the enclosing <xforms:group> statement.


Hope this helps,

Philip


nicolaspujol73 wrote
Hi,

 I am not sure if this by design or a bug but why is it that the nodeset arg of
an xforms:insert seems
to ignore the context established by a surrounding a group ? I have to refer to
make the nodeset absolute to the instance doc not relative, I also tried the
xforms 1.1 context function . No luck. Any suggestions? Thanks!

<xforms:group ref="section[@id='FORM_OA_ADDRESS_PHONE']>
   <xforms:trigger>
          <xforms:action ev:event="DOMActivate">
         
                   
                  <xforms:insert
nodeset="instance('fr-metadata')/section[@id='FORM_OA_ADDRESS_PHONE']/item"
at="last()" position="after"></xforms:insert>
   
                   
                       <xforms:insert nodeset="item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

         
                       <xforms:insert nodeset="context()/item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

           </xforms:action>
   </xforms:trigger>       
  <xforms:repeat id="repeat-FORM_OA_ADDRESS_PHONE" nodeset="item">     
   ....
  </xforms:repeat>                           
<xforms:group>


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

Re: Trigger in repeat in group

npujol
Great . Just tried that and it worked very well. Quick follow up question, do you have any suggestions as to setting up a binding on a trigger so as to limit the number of entries WHEN in a nested repeat situation? If I refer to the binding by name how do i refer to a nested trigger if orbeon's recommendation is NOT to use the index function outside an action.

Thanks for any ideas and the tip from earlier.

Philip.Cantin wrote
Nicolas,

Have a look at this link here:

http://wiki.orbeon.com/forms/how-to/repeat-insert-position


Notice how you use the 'context' attribute of <xforms:insert> to establish the context of where you want to add the node, and the 'origin' attribute to establish what node you would like to add.

Also, within an <xforms:group>, the context attribute of an <xforms:insert> statement will be relative to the ref attribute of the enclosing <xforms:group> statement.


Hope this helps,

Philip


nicolaspujol73 wrote
Hi,

 I am not sure if this by design or a bug but why is it that the nodeset arg of
an xforms:insert seems
to ignore the context established by a surrounding a group ? I have to refer to
make the nodeset absolute to the instance doc not relative, I also tried the
xforms 1.1 context function . No luck. Any suggestions? Thanks!

<xforms:group ref="section[@id='FORM_OA_ADDRESS_PHONE']>
   <xforms:trigger>
          <xforms:action ev:event="DOMActivate">
         
                   
                  <xforms:insert
nodeset="instance('fr-metadata')/section[@id='FORM_OA_ADDRESS_PHONE']/item"
at="last()" position="after"></xforms:insert>
   
                   
                       <xforms:insert nodeset="item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

         
                       <xforms:insert nodeset="context()/item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

           </xforms:action>
   </xforms:trigger>       
  <xforms:repeat id="repeat-FORM_OA_ADDRESS_PHONE" nodeset="item">     
   ....
  </xforms:repeat>                           
<xforms:group>


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

Re: Trigger in repeat in group

Philip.Cantin
Nicolas,

If I understood your question correctly...

When using binds within nested repeats, you should nest the <xforms:bind> statements to reflect the XML structure you're working with. For example:

<xf:instance id="test">
   <root>
      <e>
         <f>
            <g/>
         </f>
      </e>
   </root>
<xf:instance>

<xf:bind nodeset="e">
   <xf:bind nodeset="f">
      <xf:bind id="g-bind" nodeset="g" />
   </xf:bind>
</xf:bind>

...

<xf:group ref="instance('test')">
   <xf:repeat nodeset="e">
      ...
      <xf:repeat nodeset="f">
         ...
         <xf:trigger bind="g-bind">
         ...
         </xf:trigger>
      </xf:repeat>
   </xf:repeat>
</xf:group>


Does this answer your question?


---Philip

npujol wrote
Great . Just tried that and it worked very well. Quick follow up question, do you have any suggestions as to setting up a binding on a trigger so as to limit the number of entries WHEN in a nested repeat situation? If I refer to the binding by name how do i refer to a nested trigger if orbeon's recommendation is NOT to use the index function outside an action.

Thanks for any ideas and the tip from earlier.

Philip.Cantin wrote
Nicolas,

Have a look at this link here:

http://wiki.orbeon.com/forms/how-to/repeat-insert-position


Notice how you use the 'context' attribute of <xforms:insert> to establish the context of where you want to add the node, and the 'origin' attribute to establish what node you would like to add.

Also, within an <xforms:group>, the context attribute of an <xforms:insert> statement will be relative to the ref attribute of the enclosing <xforms:group> statement.


Hope this helps,

Philip


nicolaspujol73 wrote
Hi,

 I am not sure if this by design or a bug but why is it that the nodeset arg of
an xforms:insert seems
to ignore the context established by a surrounding a group ? I have to refer to
make the nodeset absolute to the instance doc not relative, I also tried the
xforms 1.1 context function . No luck. Any suggestions? Thanks!

<xforms:group ref="section[@id='FORM_OA_ADDRESS_PHONE']>
   <xforms:trigger>
          <xforms:action ev:event="DOMActivate">
         
                   
                  <xforms:insert
nodeset="instance('fr-metadata')/section[@id='FORM_OA_ADDRESS_PHONE']/item"
at="last()" position="after"></xforms:insert>
   
                   
                       <xforms:insert nodeset="item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

         
                       <xforms:insert nodeset="context()/item" at="last()"
position="after"></xforms:insert>
                    </xforms:insert>

           </xforms:action>
   </xforms:trigger>       
  <xforms:repeat id="repeat-FORM_OA_ADDRESS_PHONE" nodeset="item">     
   ....
  </xforms:repeat>                           
<xforms:group>


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

Re: Re: Trigger in repeat in group

npujol73
Yes it is exactly what i was asking. Thanks



On Oct 27, 2009, at 4:12 PM, "Philip.Cantin" <[hidden email]> wrote:

>
> Nicolas,
>
> If I understood your question correctly...
>
> When using binds within nested repeats, you should nest the  
> <xforms:bind>
> statements to reflect the XML structure you're working with. For  
> example:
>
> <xf:instance id="test">
>   <root>
>      <e>
>         <f>
>            <g/>
>         </f>
>      </e>
>   </root>
> <xf:instance>
>
> <xf:bind nodeset="e">
>   <xf:bind nodeset="f">
>      <xf:bind id="g-bind" nodeset="g" />
>   </xf:bind>
> </xf:bind>
>
> ...
>
> <xf:group ref="instance('test')">
>   <xf:repeat nodeset="e">
>      ...
>      <xf:repeat nodeset="f">
>         ...
>         <xf:trigger bind="g-bind">
>         ...
>         </xf:trigger>
>      </xf:repeat>
>   </xf:repeat>
> </xf:group>
>
>
> Does this answer your question?
>
>
> ---Philip
>
>
> npujol wrote:
>>
>> Great . Just tried that and it worked very well. Quick follow up  
>> question,
>> do you have any suggestions as to setting up a binding on a trigger  
>> so as
>> to limit the number of entries WHEN in a nested repeat situation?  
>> If I
>> refer to the binding by name how do i refer to a nested trigger if
>> orbeon's recommendation is NOT to use the index function outside an
>> action.
>>
>> Thanks for any ideas and the tip from earlier.
>>
>>
>> Philip.Cantin wrote:
>>>
>>> Nicolas,
>>>
>>> Have a look at this link here:
>>>
>>> http://wiki.orbeon.com/forms/how-to/repeat-insert-position
>>>
>>>
>>> Notice how you use the 'context' attribute of <xforms:insert> to
>>> establish the context of where you want to add the node, and the  
>>> 'origin'
>>> attribute to establish what node you would like to add.
>>>
>>> Also, within an <xforms:group>, the context attribute of an
>>> <xforms:insert> statement will be relative to the ref attribute of  
>>> the
>>> enclosing <xforms:group> statement.
>>>
>>>
>>> Hope this helps,
>>>
>>> Philip
>>>
>>>
>>>
>>> nicolaspujol73 wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I am not sure if this by design or a bug but why is it that the  
>>>> nodeset
>>>> arg of
>>>> an xforms:insert seems
>>>> to ignore the context established by a surrounding a group ? I  
>>>> have to
>>>> refer to
>>>> make the nodeset absolute to the instance doc not relative, I  
>>>> also tried
>>>> the
>>>> xforms 1.1 context function . No luck. Any suggestions? Thanks!
>>>>
>>>> <xforms:group ref="section[@id='FORM_OA_ADDRESS_PHONE']>
>>>>   <xforms:trigger>
>>>>      <xforms:action ev:event="DOMActivate">
>>>>
>>>>           <!-- this works but is 'absolute'-->
>>>>          <xforms:insert
>>>> nodeset="instance('fr-metadata')/section
>>>> [@id='FORM_OA_ADDRESS_PHONE']/item"
>>>> at="last()" position="after"></xforms:insert>
>>>>
>>>>            <!-- this does not work -this is relative to the group
>>>> above -->
>>>>               <xforms:insert nodeset="item" at="last()"
>>>> position="after"></xforms:insert>
>>>>            </xforms:insert>
>>>>
>>>>      <!-- the xforms 1.1 context()  does not work either -->
>>>>               <xforms:insert nodeset="context()/item" at="last()"
>>>> position="after"></xforms:insert>
>>>>            </xforms:insert>
>>>>
>>>>       </xforms:action>
>>>>   </xforms:trigger>
>>>>  <xforms:repeat id="repeat-FORM_OA_ADDRESS_PHONE" nodeset="item">
>>>>   ....
>>>>  </xforms:repeat>
>>>> <xforms:group>
>>>>
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://n4.nabble.com/Trigger-in-repeat-in-group-tp276731p277327.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
> --
> 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


--
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