How to cancel an action if an error occures

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

How to cancel an action if an error occures

Antoine.DE-TROOSTEMBERGH
How to cancel an action if an error occures

Hi,

I have the following code:

<xforms:action ev:event="DOMActivate">
    <xforms:send submission="delete-file" />
    <xforms:delete nodeset="instance('test-instance')/file/file" at="index('file-repeat')" />
</xforms:action>

Is it possible to not execute the xforms:delete if the submission fails?


Thanks,

Antoine



--
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: How to cancel an action if an error occures

fl.schmitt(ops-users)
Antoine,

> <xforms:action ev:event="DOMActivate">
>     <xforms:send submission="delete-file" />
>     <xforms:delete nodeset="instance('test-instance')/file/file"
> at="index('file-repeat')" />
> </xforms:action>

> Is it possible to not execute the xforms:delete if the submission fails?

yes - using the xforms-submit-done event [1] inside the submission element:

<xforms:submission id="save" ...>
    <xforms:delete
        ev:event="xforms-submit-done"
        nodeset="instance('test-instance')/file/file"
        at="index('file-repeat')" />
</xforms:submission>

[1] http://www.w3.org/TR/xforms11/#submit-evt-submit-done

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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: Re: How to cancel an action if an error occures

Antoine.DE-TROOSTEMBERGH
It works just fine !

Thanks Florian,

Antoine

-----Original Message-----
From: Florian Schmitt [mailto:[hidden email]]
Sent: Thursday, November 06, 2008 3:20 PM
To: [hidden email]
Subject: [ops-users] Re: How to cancel an action if an error occures

Antoine,

> <xforms:action ev:event="DOMActivate">
>     <xforms:send submission="delete-file" />
>     <xforms:delete nodeset="instance('test-instance')/file/file"
> at="index('file-repeat')" />
> </xforms:action>

> Is it possible to not execute the xforms:delete if the submission fails?

yes - using the xforms-submit-done event [1] inside the submission element:

<xforms:submission id="save" ...>
    <xforms:delete
        ev:event="xforms-submit-done"
        nodeset="instance('test-instance')/file/file"
        at="index('file-repeat')" />
</xforms:submission>

[1] http://www.w3.org/TR/xforms11/#submit-evt-submit-done

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