Need a hint on <xforms:action ev:event="xforms-submit-done">

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

Need a hint on <xforms:action ev:event="xforms-submit-done">

Martin Mohnhaupt
Dear group,

In my application I do several submissions. Some of them do not need to notify the user that they were done.
In an <xforms:action ev:event="xforms-submit-done"> action is it possible to find out what instance has been submitted and to suppress a processing part ?

Here is a bit of my code:

...
<xforms:action ev:event="xforms-submit-done">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>   


<xforms:submission id="save-submission" ref="instance('mif-document')" method="post" action="/mmpz/mif/save" replace="none"/>
<xforms:submission id="quit-submission" ref="instance('login')" method="post" action="/mmpz/mif/portal"/>

<!-- FOR THIS SUBMISSION, NO MESSAGE IS TO BE DISPLAYED -->
<xforms:submission id="serial-submission" ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number" replace="instance"/>
...

Your help is very appreciated !

All my best wishes for a happy, peaceful new year !

-Martin



-- 
Martin Mohnhaupt
Nice Data Systems
Rue de Lyon 42 - CH 1203 GENEVE
Tél: +41 (0) 22 344 11 39
Mob: +41 (0) 78 636 00 75
Email: [hidden email]
Web: http://www.nicedata.com
Skype: martin.mohnhaupt
Action Carbone: http://www.actioncarbone.org


--
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: Need a hint on <xforms:action ev:event="xforms-submit-done">

Martin Mohnhaupt
Hi again,

Sometimes thinking helps!

This is the code:

            <xforms:submission id="save-submission" ref="instance('mif-document')" method="post" action="/mmpz/mif/save" replace="none">
                <xforms:action ev:event="xforms-submit-done">
                    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
                </xforms:action>   
            </xforms:submission>   
            <xforms:submission id="quit-submission" ref="instance('login')" method="post" action="/mmpz/mif/portal"/>
            <xforms:submission id="serial-submission" ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number" replace="instance">
                <xforms:action ev:event="xforms-submit-done">
                    <!-- NO MESSAGE HERE :-) -->
                </xforms:action>
            </xforms:submission>


Kind regards !

-Martin


Martin Mohnhaupt wrote:
Dear group,

In my application I do several submissions. Some of them do not need to notify the user that they were done.
In an <xforms:action ev:event="xforms-submit-done"> action is it possible to find out what instance has been submitted and to suppress a processing part ?

Here is a bit of my code:

...
<xforms:action ev:event="xforms-submit-done">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>   


<xforms:submission id="save-submission" ref="instance('mif-document')" method="post" action="/mmpz/mif/save" replace="none"/>
<xforms:submission id="quit-submission" ref="instance('login')" method="post" action="/mmpz/mif/portal"/>

<!-- FOR THIS SUBMISSION, NO MESSAGE IS TO BE DISPLAYED -->
<xforms:submission id="serial-submission" ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number" replace="instance"/>
...

Your help is very appreciated !

All my best wishes for a happy, peaceful new year !

-Martin



-- 
Martin Mohnhaupt
Nice Data Systems
Rue de Lyon 42 - CH 1203 GENEVE
Tél: +41 (0) 22 344 11 39
Mob: +41 (0) 78 636 00 75
Email: [hidden email]
Web: http://www.nicedata.com
Skype: martin.mohnhaupt
Action Carbone: http://www.actioncarbone.org

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

-- 
Martin Mohnhaupt
Nice Data Systems
Rue de Lyon 42 - CH 1203 GENEVE
Tél: +41 (0) 22 344 11 39
Mob: +41 (0) 78 636 00 75
Email: [hidden email]
Web: http://www.nicedata.com
Skype: martin.mohnhaupt
Action Carbone: http://www.actioncarbone.org


--
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: Need a hint on <xforms:action ev:event="xforms-submit-done">

Erik Bruchez
Administrator
Martin,

Something like this will work, yes. Here are a few ways:

Duplicate the event handlers:

<xforms:submission id="save-submission" ref="instance('mif-document')"
                    method="post" action="/mmpz/mif/save"
                    replace="none">
     <xforms:action ev:event="xforms-submit-done">
         <xforms:message level="modal">Vos données ont été sauvegardées
avec succès !</xforms:message>
     </xforms:action>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                    method="post" action="/mmpz/mif/portal">
     <xforms:action ev:event="xforms-submit-done">
         <xforms:message level="modal">Vos données ont été sauvegardées
avec succès !</xforms:message>
     </xforms:action>
</xforms:submission>

<xforms:submission id="serial-submission"
                    ref="instance('serial')" method="post"
action="/mmpz/mif/get-serial-number"
                    replace="instance"/>

Keep the top-level handler but prevent propagation of the event:

<xforms:action ev:event="xforms-submit-done">
     <xforms:message level="modal">Vos données ont été sauvegardées avec
succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                    method="post" action="/mmpz/mif/save"
                    replace="none"/>
<xforms:submission id="quit-submission" ref="instance('login')"
                    method="post" action="/mmpz/mif/portal"/>

<xforms:submission id="serial-submission"
                    ref="instance('serial')" method="post"
action="/mmpz/mif/get-serial-number"
                    replace="instance">
     <xforms:action ev:event="xforms-submit-done" propagate="false"/>
</xforms:submission>

Throw a custom event:

<xforms:action ev:event="my-display-success-message">
     <xforms:message level="modal">Vos données ont été sauvegardées avec
succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                    method="post" action="/mmpz/mif/save"
                    replace="none">
     <xforms:dispatch name="my-display-success-message"
target="id-of-the-current-model"/>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                    method="post" action="/mmpz/mif/portal">
     <xforms:dispatch name="my-display-success-message"
target="id-of-the-current-model"/>
</xforms:submission>

<xforms:submission id="serial-submission"
                    ref="instance('serial')" method="post"
action="/mmpz/mif/get-serial-number"
                    replace="instance"/>

A way that should work but doesn't at the moment in Orbeon Forms:

<xforms:action id="message-handler">
     <xforms:message level="modal">Vos données ont été sauvegardées avec
succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                    method="post" action="/mmpz/mif/save"
                    replace="none">
     <ev:listener event="xforms-submit-done" handler="#message-handler"/>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                    method="post" action="/mmpz/mif/portal">
     <ev:listener event="xforms-submit-done" handler="#message-handler"/>
</xforms:submission>

<xforms:submission id="serial-submission"
                    ref="instance('serial')" method="post"
action="/mmpz/mif/get-serial-number"
                    replace="instance"/>

Finally, another way that should work but doesn't at the moment in
Orbeon Forms:

<xforms:action id="message-handler">
     <xforms:message level="modal">Vos données ont été sauvegardées avec
succès !</xforms:message>
</xforms:action>

<ev:listener event="xforms-submit-done" handler="#message-handler"
observer="save-submission"/>
<ev:listener event="xforms-submit-done" handler="#message-handler"
observer="quit-submission"/>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                    method="post" action="/mmpz/mif/save"
                    replace="none"/>

<xforms:submission id="quit-submission" ref="instance('login')"
                    method="post" action="/mmpz/mif/portal"/>

<xforms:submission id="serial-submission"
                    ref="instance('serial')" method="post"
action="/mmpz/mif/get-serial-number"
                    replace="instance"/>

Happy New Year!

-Erik

Martin Mohnhaupt wrote:
 > Hi again,
 >
 > Sometimes thinking helps!
 >
 > This is the code:
 >
 >             <xforms:submission id="save-submission"
 > ref="instance('mif-document')" method="post" action="/mmpz/mif/save"
 > replace="none">
 >                 <xforms:action ev:event="xforms-submit-done">
 >                     <xforms:message level="modal">Vos données ont été
 > sauvegardées avec succès !</xforms:message>
 >                 </xforms:action>
 >             </xforms:submission>
 >             <xforms:submission id="quit-submission"
 > ref="instance('login')" method="post" action="/mmpz/mif/portal"/>
 >             <xforms:submission id="serial-submission"
 > ref="instance('serial')" method="post"
 > action="/mmpz/mif/get-serial-number" replace="instance">
 >                 <xforms:action ev:event="xforms-submit-done">
 >                     <!-- NO MESSAGE HERE :-) -->
 >                 </xforms:action>
 >             </xforms:submission>
 >
 >
 > Kind regards !
 >
 > -Martin
 >
 >
 > Martin Mohnhaupt wrote:
 >> Dear group,
 >>
 >> In my application I do several submissions. Some of them do not need
 >> to notify the user that they were done.
 >> In an <xforms:action ev:event="xforms-submit-done"> action is it
 >> possible to find out what instance has been submitted and to suppress
 >> a processing part ?
 >>
 >> Here is a bit of my code:
 >>
 >> ...
 >> <xforms:action ev:event="xforms-submit-done">
 >>     <xforms:message level="modal">Vos données ont été sauvegardées
 >> avec succès !</xforms:message>
 >> </xforms:action>
 >>
 >>
 >> <xforms:submission id="save-submission" ref="instance('mif-document')"
 >> method="post" action="/mmpz/mif/save" replace="none"/>
 >> <xforms:submission id="quit-submission" ref="instance('login')"
 >> method="post" action="/mmpz/mif/portal"/>
 >>
 >> <!-- FOR THIS SUBMISSION, NO MESSAGE IS TO BE DISPLAYED -->
 >> <xforms:submission id="serial-submission" ref="instance('serial')"
 >> method="post" action="/mmpz/mif/get-serial-number" replace="instance"/>
 >> ...
 >>
 >> Your help is very appreciated !
 >>
 >> All my best wishes for a happy, peaceful new year !
 >>
 >> -Martin
 >>
 >>
 >>
 >> --
 >> Martin Mohnhaupt
 >> Nice Data Systems
 >> Rue de Lyon 42 - CH 1203 GENEVE
 >> Tél: +41 (0) 22 344 11 39
 >> Mob: +41 (0) 78 636 00 75
 >> Email: [hidden email]
 >> Web: http://www.nicedata.com
 >> Skype: martin.mohnhaupt
 >> Action Carbone: http://www.actioncarbone.org
 >> ------------------------------------------------------------------------

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Need a hint on <xforms:action ev:event="xforms-submit-done">

Martin Mohnhaupt
Thank you very much, Erik!



Erik Bruchez wrote:
Martin,

Something like this will work, yes. Here are a few ways:

Duplicate the event handlers:

<xforms:submission id="save-submission" ref="instance('mif-document')"
                   method="post" action="/mmpz/mif/save"
                   replace="none">
    <xforms:action ev:event="xforms-submit-done">
        <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
    </xforms:action>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                   method="post" action="/mmpz/mif/portal">
    <xforms:action ev:event="xforms-submit-done">
        <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
    </xforms:action>
</xforms:submission>

<xforms:submission id="serial-submission"
                   ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number"
                   replace="instance"/>

Keep the top-level handler but prevent propagation of the event:

<xforms:action ev:event="xforms-submit-done">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                   method="post" action="/mmpz/mif/save"
                   replace="none"/>
<xforms:submission id="quit-submission" ref="instance('login')"
                   method="post" action="/mmpz/mif/portal"/>

<xforms:submission id="serial-submission"
                   ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number"
                   replace="instance">
    <xforms:action ev:event="xforms-submit-done" propagate="false"/>
</xforms:submission>

Throw a custom event:

<xforms:action ev:event="my-display-success-message">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                   method="post" action="/mmpz/mif/save"
                   replace="none">
    <xforms:dispatch name="my-display-success-message" target="id-of-the-current-model"/>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                   method="post" action="/mmpz/mif/portal">
    <xforms:dispatch name="my-display-success-message" target="id-of-the-current-model"/>
</xforms:submission>

<xforms:submission id="serial-submission"
                   ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number"
                   replace="instance"/>

A way that should work but doesn't at the moment in Orbeon Forms:

<xforms:action id="message-handler">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                   method="post" action="/mmpz/mif/save"
                   replace="none">
    <ev:listener event="xforms-submit-done" handler="#message-handler"/>
</xforms:submission>

<xforms:submission id="quit-submission" ref="instance('login')"
                   method="post" action="/mmpz/mif/portal">
    <ev:listener event="xforms-submit-done" handler="#message-handler"/>
</xforms:submission>

<xforms:submission id="serial-submission"
                   ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number"
                   replace="instance"/>

Finally, another way that should work but doesn't at the moment in Orbeon Forms:

<xforms:action id="message-handler">
    <xforms:message level="modal">Vos données ont été sauvegardées avec succès !</xforms:message>
</xforms:action>

<ev:listener event="xforms-submit-done" handler="#message-handler" observer="save-submission"/>
<ev:listener event="xforms-submit-done" handler="#message-handler" observer="quit-submission"/>

<xforms:submission id="save-submission" ref="instance('mif-document')"
                   method="post" action="/mmpz/mif/save"
                   replace="none"/>

<xforms:submission id="quit-submission" ref="instance('login')"
                   method="post" action="/mmpz/mif/portal"/>

<xforms:submission id="serial-submission"
                   ref="instance('serial')" method="post" action="/mmpz/mif/get-serial-number"
                   replace="instance"/>

Happy New Year!

-Erik

Martin Mohnhaupt wrote:
> Hi again,
>
> Sometimes thinking helps!
>
> This is the code:
>
>             <xforms:submission id="save-submission"
> ref="instance('mif-document')" method="post" action="/mmpz/mif/save"
> replace="none">
>                 <xforms:action ev:event="xforms-submit-done">
>                     <xforms:message level="modal">Vos données ont été
> sauvegardées avec succès !</xforms:message>
>                 </xforms:action>
>             </xforms:submission>
>             <xforms:submission id="quit-submission"
> ref="instance('login')" method="post" action="/mmpz/mif/portal"/>
>             <xforms:submission id="serial-submission"
> ref="instance('serial')" method="post"
> action="/mmpz/mif/get-serial-number" replace="instance">
>                 <xforms:action ev:event="xforms-submit-done">
>                     <!-- NO MESSAGE HERE :-) -->
>                 </xforms:action>
>             </xforms:submission>
>
>
> Kind regards !
>
> -Martin
>
>
> Martin Mohnhaupt wrote:
>> Dear group,
>>
>> In my application I do several submissions. Some of them do not need
>> to notify the user that they were done.
>> In an <xforms:action ev:event="xforms-submit-done"> action is it
>> possible to find out what instance has been submitted and to suppress
>> a processing part ?
>>
>> Here is a bit of my code:
>>
>> ...
>> <xforms:action ev:event="xforms-submit-done">
>>     <xforms:message level="modal">Vos données ont été sauvegardées
>> avec succès !</xforms:message>
>> </xforms:action>
>>
>>
>> <xforms:submission id="save-submission" ref="instance('mif-document')"
>> method="post" action="/mmpz/mif/save" replace="none"/>
>> <xforms:submission id="quit-submission" ref="instance('login')"
>> method="post" action="/mmpz/mif/portal"/>
>>
>> <!-- FOR THIS SUBMISSION, NO MESSAGE IS TO BE DISPLAYED -->
>> <xforms:submission id="serial-submission" ref="instance('serial')"
>> method="post" action="/mmpz/mif/get-serial-number" replace="instance"/>
>> ...
>>
>> Your help is very appreciated !
>>
>> All my best wishes for a happy, peaceful new year !
>>
>> -Martin
>>
>>
>>
>> --
>> Martin Mohnhaupt
>> Nice Data Systems
>> Rue de Lyon 42 - CH 1203 GENEVE
>> Tél: +41 (0) 22 344 11 39
>> Mob: +41 (0) 78 636 00 75
>> Email: [hidden email]
>> Web: http://www.nicedata.com
>> Skype: martin.mohnhaupt
>> Action Carbone: http://www.actioncarbone.org
>> ------------------------------------------------------------------------


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

-- 
Martin Mohnhaupt
Nice Data Systems
Rue de Lyon 42 - CH 1203 GENEVE
Tél: +41 (0) 22 344 11 39
Mob: +41 (0) 78 636 00 75
Email: [hidden email]
Web: http://www.nicedata.com
Skype: martin.mohnhaupt
Action Carbone: http://www.actioncarbone.org


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