Can I do two submissions in one action?

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

Can I do two submissions in one action?

masjab-2
Hey all, 

I have the following problem: 

I have data in a table which is repeated into rows. Now if you select one row you can click on an "edit" button.
This data should be written into exist (temporarely) to lock it, because I want wo prevent other users to edit the same entry...

All this should be done as following:
- write the data into exist by a xquery, that checks if the id of the data is already locked
- if not it should be written into an "2edit.xml" file
- this 2edit.xml file should be the initial file to fill my "edit" mask on an edit-page

Now my problem is that I don´t know if I can do all this with one trigger.

My code looks like this right now:

<xforms:trigger>
                            <xforms:label>Edit</xforms:label>
                            <xforms:action ev:event="DOMActivate">

<!-- here my toEdit-instance should be filled with the data chosen in a specific row, thats working....-->
                                <xforms:insert
                                    context="instance('toEdit')"
                                    nodeset="root"
                                    at="1"
                                    position="after"
                                    origin="instance('user')/remote-user"/>
                                <xforms:insert  
                                    context="instance('toEdit')"
                                    nodeset="remote-user"
                                    at="last()"
                                    position="after"
                                    origin="xxforms:context('sr-repeat')"/>

<!-- here is my PROBLEM: first the "toEditSubmission" should be done and depending on what my edit.xq does it should eather give an error message or submit the "link-edit" which leads to my edit-page --> 
                                <xforms:send submission="toEditSubmission"/>
                                <xforms:send submission="link-edit"/>
                            </xforms:action>
 </xforms:trigger>


Maybe the edit.xq can call an URL, but  don´t know how...


As always:THX FOR YOUR HELP!!!!



--
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: Can I do two submissions in one action?

Erik Bruchez
Administrator
In this case you should "chain" the submission, e.g. the second one is  
triggered upon xforms-submit-done of the first one.

-Erik

On Jul 11, 2008, at 1:14 AM, Masen J wrote:

> Hey all,
>
> I have the following problem:
>
> I have data in a table which is repeated into rows. Now if you  
> select one row you can click on an "edit" button.
> This data should be written into exist (temporarely) to lock it,  
> because I want wo prevent other users to edit the same entry...
>
> All this should be done as following:
> - write the data into exist by a xquery, that checks if the id of  
> the data is already locked
> - if not it should be written into an "2edit.xml" file
> - this 2edit.xml file should be the initial file to fill my "edit"  
> mask on an edit-page
>
> Now my problem is that I don´t know if I can do all this with one  
> trigger.
>
> My code looks like this right now:
>
> <xforms:trigger>
>                             <xforms:label>Edit</xforms:label>
>                             <xforms:action ev:event="DOMActivate">
>
> <!-- here my toEdit-instance should be filled with the data chosen  
> in a specific row, thats working....-->
>                                 <xforms:insert
>                                     context="instance('toEdit')"
>                                     nodeset="root"
>                                     at="1"
>                                     position="after"
>                                     origin="instance('user')/remote-
> user"/>
>                                 <xforms:insert
>                                     context="instance('toEdit')"
>                                     nodeset="remote-user"
>                                     at="last()"
>                                     position="after"
>                                     origin="xxforms:context('sr-
> repeat')"/>
>
> <!-- here is my PROBLEM: first the "toEditSubmission" should be done  
> and depending on what my edit.xq does it should eather give an error  
> message or submit the "link-edit" which leads to my edit-page -->
>                                 <xforms:send  
> submission="toEditSubmission"/>
>                                 <xforms:send submission="link-edit"/>
>                             </xforms:action>
>  </xforms:trigger>
>
>
> Maybe the edit.xq can call an URL, but  don´t know how...
>
>
> As always:THX FOR YOUR HELP!!!!
>
>
> --
> 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
--
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
OW2 mailing lists service home page: http://www.ow2.org/wws