Multiple send in a trigger

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

Multiple send in a trigger

mjgraham
Hi,

I'm wondering whether multiple sends are possible in a trigger:

<xf:submission ref="instance('instance')" id="submit-main"
replace="instance" instance="session" action="apps/execute" />
<xf:submission ref="instance('instance')" id="submit-upload'
action="apps/upload"/>
...
<xf:trigger>
  <xf:label>Submit</xf:label>
  <xf:action ev:event="DOMActivate">
    <xf:send submission="submit-upload"/>
    <xf:send submission="submit-main"/>
  </xf:action>
</xf:trigger>

I'm trying to get around the limitation that xupload can only be used
with a replace="all" - the apps/upload returns nothing.

However, only the first send is being carried out.

    Cheers,

    Matthew



--
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: Multiple send in a trigger

Erik Bruchez
Administrator
Matthew,

Yes, that should work.

-Erik

Matthew Graham wrote:

> Hi,
>
> I'm wondering whether multiple sends are possible in a trigger:
>
> <xf:submission ref="instance('instance')" id="submit-main"
> replace="instance" instance="session" action="apps/execute" />
> <xf:submission ref="instance('instance')" id="submit-upload'
> action="apps/upload"/>
> ...
> <xf:trigger>
>  <xf:label>Submit</xf:label>
>  <xf:action ev:event="DOMActivate">
>    <xf:send submission="submit-upload"/>
>    <xf:send submission="submit-main"/>
>  </xf:action>
> </xf:trigger>
>
> I'm trying to get around the limitation that xupload can only be used
> with a replace="all" - the apps/upload returns nothing.
>
> However, only the first send is being carried out.
>
>    Cheers,
>
>    Matthew
--
Orbeon - XForms Everywhere:
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
Reply | Threaded
Open this post in threaded view
|

Re: Multiple send in a trigger

Adrian Baker
Check that you still want the second submission to go ahead if the first
one fails, which it will if you invoke both sends from within the trigger.

If you didn't want this, you can trigger the second submission off the
submit-done event of the first instead:

<xf:submission ref="instance('instance')" id="submit-main"
replace="instance" instance="session" action="apps/execute" >
    <xf:send submission="submit-upload" ev:event="xforms-submit-done"/>
</xf:submission>

Adrian

Erik Bruchez wrote:

> Matthew,
>
> Yes, that should work.
>
> -Erik
>
> Matthew Graham wrote:
>> Hi,
>>
>> I'm wondering whether multiple sends are possible in a trigger:
>>
>> <xf:submission ref="instance('instance')" id="submit-main"
>> replace="instance" instance="session" action="apps/execute" />
>> <xf:submission ref="instance('instance')" id="submit-upload'
>> action="apps/upload"/>
>> ...
>> <xf:trigger>
>>  <xf:label>Submit</xf:label>
>>  <xf:action ev:event="DOMActivate">
>>    <xf:send submission="submit-upload"/>
>>    <xf:send submission="submit-main"/>
>>  </xf:action>
>> </xf:trigger>
>>
>> I'm trying to get around the limitation that xupload can only be used
>> with a replace="all" - the apps/upload returns nothing.
>>
>> However, only the first send is being carried out.
>>
>>    Cheers,
>>
>>    Matthew
>
> ------------------------------------------------------------------------
>
>
> --
> 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
>  



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