Hi,
I am having a few problems trying to achieve the following behaviour using Orbeon Forms: I have an XHTML page containing two xforms model instances. The first instance contains some user data displayed on the page, the second instance contains data I use to control where to navigate to next. The behaviour I hope to achieve is to be able to trigger a submission such that an XPL pipeline is first run to process data from model instance 1. As part of the same trigger operation I was then hoping to be able to navigate to a new page based on the data contained in model instance 2. I know how to perform a submission to be able to process the first instance with an XPL pipeline. For example in my XHTML: <xforms:submission id="main-submission" ref="instance('main-data')" method="post" resource="main"/> ... <xforms:submit submission="main-submission"> <xforms:label>Submit the first model instance</xforms:label> </xforms:submit> and in the page-flow: <c:page id="main" path-info="/main" model="processMain.xpl"/> However I'm not clear if it is then possible to redirect to another page based on data stored in the second instance. The closest I've got is to add a default action to the above page element: <c:page id="main" path-info="/main" model="processMain.xpl"> <c:action> <c:result page="newPage"/> </c:action> This successfully displays the newPage, but only has access to the default submission. I am not clear if it is then possible to redirect to the new page based on data stored in the second instance from the original page. Is it possible to do something like this, or have I missed an obvious alternative? Thanks in advance for any assistance. Regards, Neil |
The page-flow controller works with xforms, but it is not part of it. If you navigate to a new page -- your submission has the attribute replace="all" then the url changes and indeed you cannot access the instances you created on the other page. (Actually, with Orbeon there ways to have global instances but they are read-only.) It sounds like you want the page-flow controller to inspect the instance to determine where to branch to, but only one instance can be passed in a submission and so page-flow can only look at the default instance. Some options are to use the <action> element with the attribute value template (variables enclosed with {}) to successively do the first submission, then update the target of the second, then submit to it also (moving to the new page). Or, use case and switch to change the presented view, but not the actual page. I hope that make some sense. --Hank On Sep 21, 2008, at 4:13 PM, ncrofts wrote: > > Hi, > > I am having a few problems trying to achieve the following > behaviour using > Orbeon Forms: > > I have an XHTML page containing two xforms model instances. The first > instance contains some user data displayed on the page, the second > instance > contains data I use to control where to navigate to next. > > The behaviour I hope to achieve is to be able to trigger a > submission such > that an XPL pipeline is first run to process data from model > instance 1. As > part of the same trigger operation I was then hoping to be able to > navigate > to a new page based on the data contained in model instance 2. > > I know how to perform a submission to be able to process the first > instance > with an XPL pipeline. For example in my XHTML: > > <xforms:submission id="main-submission" ref="instance('main-data')" > method="post" resource="main"/> > > ... > > <xforms:submit submission="main-submission"> > <xforms:label>Submit the first model instance</xforms:label> > </xforms:submit> > > and in the page-flow: > > <c:page id="main" path-info="/main" model="processMain.xpl"/> > > However I'm not clear if it is then possible to redirect to another > page > based on data stored in the second instance. > > The closest I've got is to add a default action to the above page > element: > > <c:page id="main" path-info="/main" model="processMain.xpl"> > > <c:action> > > <c:result page="newPage"/> > > </c:action> > > > This successfully displays the newPage, but only has access to the > default > submission. I am not clear if it is then possible to redirect to > the new > page based on data stored in the second instance from the original > page. > > Is it possible to do something like this, or have I missed an obvious > alternative? > > Thanks in advance for any assistance. > > Regards, > Neil > -- > View this message in context: http://www.nabble.com/Processing- > multiple-xforms-instances.-tp19599553p19599553.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 NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Thanks for the thoughts on my issue. I understand part of what was said, but I'm afraid I am not sure about the last part regarding the the <action> element with the attribute value template. I don't really understand what this means. I don't think the alternative case and switch method is appropriate for my intended solution.
Perhaps if I try and explain again the essence of what I am trying to achieve it will be.. Essentially, what I want to do is when a trigger occurs I need to process one of the model instances using an XPL pipeline. Following this task I then want to submit a different model instance and using information in that instance the page flow can determine which page to display next. I can't help but feel this is a fairly standard thing that people would want to do in a web application i.e. perform some task on model data specific to a page, and then navigate to the next page based on another set of data. Have I missed something really obvious in the way Orbeon Forms works? Regards, Neil
|
Hi Neil, Lots of technologies... For a single trigger, you can have multiple submissions, because the <action> element is a wrapper for multiple actions. Crudely, <trigger ev:action="DOMActivate"> <label>push</label> <action> <send submission="submit1"> <setvalue ref="instance('different-model')/thing/to/change/" value="..."/> <send submission="submit2"> </action> </trigger> Which will process one model instance, then change something in the second model, presumably using what the submit had changed, then make that submission. Also assumes that on the first submit, replace="instance" and not "all". The thing is, all this is handled in xforms, and not in the page-flow. Well, the page-flow could branch to a new location based on the instance. What I meant by ATV is that your submission or a bind calculation can use {$var} notation to expand variables. In that case, you may not even need to use setvalue, it's done by variable substitution. http://www.orbeon.com/ops/doc/reference-xforms-2#avts I don't use page-flow much for navigation, mostly to define target urls, so I would like to defer on that. HTH, Hank On Sep 22, 2008, at 3:44 PM, ncrofts wrote: > > Thanks for the thoughts on my issue. I understand part of what was > said, but > I'm afraid I am not sure about the last part regarding the the > <action> > element with the attribute value template. I don't really > understand what > this means. I don't think the alternative case and switch method is > appropriate for my intended solution. > > Perhaps if I try and explain again the essence of what I am trying to > achieve it will be.. > > Essentially, what I want to do is when a trigger occurs I need to > process > one of the model instances using an XPL pipeline. Following this > task I then > want to submit a different model instance and using information in > that > instance the page flow can determine which page to display next. > > I can't help but feel this is a fairly standard thing that people > would want > to do in a web application i.e. perform some task on model data > specific to > a page, and then navigate to the next page based on another set of > data. > Have I missed something really obvious in the way Orbeon Forms works? > > Regards, > Neil > > > > > > > > > > > Hank Ratzesberger wrote: >> >> >> The page-flow controller works with xforms, but it is not part of it. >> >> If you navigate to a new page -- your submission has the attribute >> replace="all" then the url changes and indeed you cannot access the >> instances you created on the other page. (Actually, with Orbeon >> there >> ways to have global instances but they are read-only.) >> >> It sounds like you want the page-flow controller to inspect the >> instance to determine where to branch to, but only one instance >> can be passed in a submission and so page-flow can only look at >> the default instance. >> >> Some options are to use the <action> element with the attribute >> value template (variables enclosed with {}) to successively do >> the first submission, then update the target of the second, then >> submit to it also (moving to the new page). Or, use case and switch >> to change the presented view, but not the actual page. >> >> I hope that make some sense. >> >> --Hank >> >> >> On Sep 21, 2008, at 4:13 PM, ncrofts wrote: >> >>> >>> Hi, >>> >>> I am having a few problems trying to achieve the following >>> behaviour using >>> Orbeon Forms: >>> >>> I have an XHTML page containing two xforms model instances. The >>> first >>> instance contains some user data displayed on the page, the second >>> instance >>> contains data I use to control where to navigate to next. >>> >>> The behaviour I hope to achieve is to be able to trigger a >>> submission such >>> that an XPL pipeline is first run to process data from model >>> instance 1. As >>> part of the same trigger operation I was then hoping to be able to >>> navigate >>> to a new page based on the data contained in model instance 2. >>> >>> I know how to perform a submission to be able to process the first >>> instance >>> with an XPL pipeline. For example in my XHTML: >>> >>> <xforms:submission id="main-submission" ref="instance('main-data')" >>> method="post" resource="main"/> >>> >>> ... >>> >>> <xforms:submit submission="main-submission"> >>> <xforms:label>Submit the first model instance</xforms:label> >>> </xforms:submit> >>> >>> and in the page-flow: >>> >>> <c:page id="main" path-info="/main" model="processMain.xpl"/> >>> >>> However I'm not clear if it is then possible to redirect to another >>> page >>> based on data stored in the second instance. >>> >>> The closest I've got is to add a default action to the above page >>> element: >>> >>> <c:page id="main" path-info="/main" model="processMain.xpl"> >>> >>> <c:action> >>> >>> <c:result page="newPage"/> >>> >>> </c:action> >>> >>> >>> This successfully displays the newPage, but only has access to the >>> default >>> submission. I am not clear if it is then possible to redirect to >>> the new >>> page based on data stored in the second instance from the original >>> page. >>> >>> Is it possible to do something like this, or have I missed an >>> obvious >>> alternative? >>> >>> Thanks in advance for any assistance. >>> >>> Regards, >>> Neil >>> -- >>> View this message in context: http://www.nabble.com/Processing- >>> multiple-xforms-instances.-tp19599553p19599553.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 >> >> Hank Ratzesberger >> NEES@UCSB >> Institute for Crustal Studies, >> University of California, Santa Barbara >> 805-893-8042 >> >> >> >> >> >> >> >> -- >> 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://www.nabble.com/Processing- > multiple-xforms-instances.-tp19599553p19616290.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 NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Hi Hank,
Thanks for the clarifications which are very helpful. I will investigate making multiple submissions as you indicate below as I think this most closely represents what I need to do. I'll post back when I've solved the issue. Thanks again for your help. Regards, Neil
|
Administrator
|
In reply to this post by ncrofts
Neil,
The crux of the issue is that XForms can only submit one instance at a time. But I am not sure this is a problem in your case. It may help to make a distinction between "pages" and "services", with a page being something displayed to the user, and a service being something processing data. So with this in mind, it seems that what you want something like this: 1. Have your XForms page call a service, passing it an instance and possibly receiving some data back 2. Have your XForms page submit an instance to the Page Flow controller, which then sends a new page back #1 above can be done with: * A service implemented with XPL * An entry in the page flow exposing this service * A submission with replace="instance" or replace="none". That is, the submission does not cause the current page to go away. #2 above can be done with: * An entry in the page flow with <action> and <result> elements * A submission with replace="all". That is, the submission causes an entirely new page to load. Not sure if this is clear or not. -Erik On Sep 22, 2008, at 3:44 PM, ncrofts wrote: > > Thanks for the thoughts on my issue. I understand part of what was > said, but > I'm afraid I am not sure about the last part regarding the the > <action> > element with the attribute value template. I don't really understand > what > this means. I don't think the alternative case and switch method is > appropriate for my intended solution. > > Perhaps if I try and explain again the essence of what I am trying to > achieve it will be.. > > Essentially, what I want to do is when a trigger occurs I need to > process > one of the model instances using an XPL pipeline. Following this > task I then > want to submit a different model instance and using information in > that > instance the page flow can determine which page to display next. > > I can't help but feel this is a fairly standard thing that people > would want > to do in a web application i.e. perform some task on model data > specific to > a page, and then navigate to the next page based on another set of > data. > Have I missed something really obvious in the way Orbeon Forms works? > > Regards, > Neil > > > > > > > > > > > Hank Ratzesberger wrote: >> >> >> The page-flow controller works with xforms, but it is not part of it. >> >> If you navigate to a new page -- your submission has the attribute >> replace="all" then the url changes and indeed you cannot access the >> instances you created on the other page. (Actually, with Orbeon >> there >> ways to have global instances but they are read-only.) >> >> It sounds like you want the page-flow controller to inspect the >> instance to determine where to branch to, but only one instance >> can be passed in a submission and so page-flow can only look at >> the default instance. >> >> Some options are to use the <action> element with the attribute >> value template (variables enclosed with {}) to successively do >> the first submission, then update the target of the second, then >> submit to it also (moving to the new page). Or, use case and switch >> to change the presented view, but not the actual page. >> >> I hope that make some sense. >> >> --Hank >> >> >> On Sep 21, 2008, at 4:13 PM, ncrofts wrote: >> >>> >>> Hi, >>> >>> I am having a few problems trying to achieve the following >>> behaviour using >>> Orbeon Forms: >>> >>> I have an XHTML page containing two xforms model instances. The >>> first >>> instance contains some user data displayed on the page, the second >>> instance >>> contains data I use to control where to navigate to next. >>> >>> The behaviour I hope to achieve is to be able to trigger a >>> submission such >>> that an XPL pipeline is first run to process data from model >>> instance 1. As >>> part of the same trigger operation I was then hoping to be able to >>> navigate >>> to a new page based on the data contained in model instance 2. >>> >>> I know how to perform a submission to be able to process the first >>> instance >>> with an XPL pipeline. For example in my XHTML: >>> >>> <xforms:submission id="main-submission" ref="instance('main-data')" >>> method="post" resource="main"/> >>> >>> ... >>> >>> <xforms:submit submission="main-submission"> >>> <xforms:label>Submit the first model instance</xforms:label> >>> </xforms:submit> >>> >>> and in the page-flow: >>> >>> <c:page id="main" path-info="/main" model="processMain.xpl"/> >>> >>> However I'm not clear if it is then possible to redirect to another >>> page >>> based on data stored in the second instance. >>> >>> The closest I've got is to add a default action to the above page >>> element: >>> >>> <c:page id="main" path-info="/main" model="processMain.xpl"> >>> >>> <c:action> >>> >>> <c:result page="newPage"/> >>> >>> </c:action> >>> >>> >>> This successfully displays the newPage, but only has access to the >>> default >>> submission. I am not clear if it is then possible to redirect to >>> the new >>> page based on data stored in the second instance from the original >>> page. >>> >>> Is it possible to do something like this, or have I missed an >>> obvious >>> alternative? >>> >>> Thanks in advance for any assistance. >>> >>> Regards, >>> Neil >>> -- >>> View this message in context: http://www.nabble.com/Processing- >>> multiple-xforms-instances.-tp19599553p19599553.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 >> >> Hank Ratzesberger >> NEES@UCSB >> Institute for Crustal Studies, >> University of California, Santa Barbara >> 805-893-8042 >> >> >> >> >> >> >> >> -- >> 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://www.nabble.com/Processing-multiple-xforms-instances.-tp19599553p19616290.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 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 |
Hi Erik,
I think you have hit right at the heart of my misunderstanding. Yes, the situation I have is a case where I want to run a "service" without changing page and then following this perform another submission to cause a "page" to load. I had also not understood the purpose of the "replace" attribute of the submission element. I think I now have a much better understanding of the flow of the system, so hopefully I can now put this into practise and get the solution I need. Thank you for the excellent explanation of the different operations. Regards, Neil
|
Free forum by Nabble | Edit this page |