How to implement a custom "Finish page" best?

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

How to implement a custom "Finish page" best?

mabu
Hi,

I want to achieve following process flow for an end user when filling out a form:
1.) After the user filled out the form he clicks on a button called "Check/Send Data" (orbeon review button with overriden label)
2.) If the validation is ok, the user is forwarded to the "Review page" where he is able to check his input data.
3.) The "Review page" has a button "Send" where the user is able to finally send the form.
4.) After the form was successfully sent, the user is forwared to a "Finish page" where he gets final information about the form.


My solution:

1.) I copied the form runner page-flow.xml and added a rule for the "Finish page" (finish.xhtml)

<page path="/fr/([^/^.]+)/([^/^.]+)/(finish)" default-submission="request-parameters.xml" model="finish/finish.xhtml" view="html-view.xpl">
    <setvalue ref="/*/app"      matcher-group="1"/>
    <setvalue ref="/*/form"     matcher-group="2"/>
    <setvalue ref="/*/mode">view</setvalue>
</page>

2.) I created a custom model (custom-model.xml)

<property as="xs:anyURI" name="oxf.fr.detail.model.custom.*.*" value='oxf:/forms/custom/custom-model.xml'/>

3.) I customized the send action/button

<property as="xs:string" name="oxf.fr.detail.process.send.*.*">
    save-final
    then xf:send("send-form")
    recover error-message("process-error")
</property>


Can you please give me some feedback about my solution. Do you have better ideas/solutions?
A problem of my solution is that when using the browser back button to navigate back from the "Finish page" to the "Review page" a user is able to send the form again.


Martin
Reply | Threaded
Open this post in threaded view
|

Re: How to implement a custom "Finish page" best?

Alessandro  Vernet
Administrator
Hi Martin,

This is a use case we support out-of-the-box, but it just that the
"finish" page needs to be done outside of Orbeon Forms. I.e., without
any change to the page flow, or any file part of Form Runner, you can
use the navigate() action in your process to send the user to a page
after they've submitted the data.

https://github.com/orbeon/orbeon-forms/wiki/Form-Runner-~-Buttons-and-Processes#navigate

Preventing users from hitting back and re-submitting the data is
something we have talked about, but I think didn't have an issue to
track. So for now, I created this issue"

https://github.com/orbeon/orbeon-forms/issues/2068

Alex

On Wed, Jan 14, 2015 at 5:05 AM, mabu <[hidden email]> wrote:

> Hi,
>
> I want to achieve following process flow for an end user when filling out a
> form:
> 1.) After the user filled out the form he clicks on a button called
> "Check/Send Data" (orbeon review button with overriden label)
> 2.) If the validation is ok, the user is forwarded to the "Review page"
> where he is able to check his input data.
> 3.) The "Review page" has a button "Send" where the user is able to finally
> send the form.
> 4.) After the form was successfully sent, the user is forwared to a "Finish
> page" where he gets final information about the form.
>
>
> My solution:
>
> 1.) I copied the form runner page-flow.xml and added a rule for the "Finish
> page" ( finish.xhtml <http://discuss.orbeon.com/file/n4659431/finish.xhtml>
> )
>
> <page path="/fr/([^/^.]+)/([^/^.]+)/(finish)"
> default-submission="request-parameters.xml" model="finish/finish.xhtml"
> view="html-view.xpl">
>     <setvalue ref="/*/app"      matcher-group="1"/>
>     <setvalue ref="/*/form"     matcher-group="2"/>
>     <setvalue ref="/*/mode">view</setvalue>
> </page>
>
> 2.) I created a custom model ( custom-model.xml
> <http://discuss.orbeon.com/file/n4659431/custom-model.xml>  )
>
> <property as="xs:anyURI" name="oxf.fr.detail.model.custom.*.*"
> value='oxf:/forms/custom/custom-model.xml'/>
>
> 3.) I customized the send action/button
>
> <property as="xs:string" name="oxf.fr.detail.process.send.*.*">
>     save-final
>     then xf:send("send-form")
>     recover error-message("process-error")
> </property>
>
>
> Can you please give me some feedback about my solution. Do you have better
> ideas/solutions?
> A problem of my solution is that when using the browser back button to
> navigate back from the "Finish page" to the "Review page" a user is able to
> send the form again.
>
>
> Martin
>
> --
> View this message in context: http://discuss.orbeon.com/How-to-implement-a-custom-Finish-page-best-tp4659431.html
> Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.
>
> --
> You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: How to implement a custom "Finish page" best?

mabu
Hi Alex,

Thank's for the feedback. I will give it a try using the navigate() action.
A little disadvantage of your solution is that I have to rebuild the layout of the form header (receiver of the form, title) in the "external finish page".

Martin
Reply | Threaded
Open this post in threaded view
|

Re: How to implement a custom "Finish page" best?

Alessandro  Vernet
Administrator
Hi Martin,

True. If all you want to do is show a page telling the user the data was submitted with the same layout as the form itself. This would be a good addition. For now, I've create this RFE:

https://github.com/orbeon/orbeon-forms/issues/2078

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet