best way to show error page on custom submission error

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

best way to show error page on custom submission error

mabu
Hi,

what is the preferred way to show the error page after an error on a custom submission?
With my solution, a redirect to the error page is performed. Is it possible to show the error page content without changing the current url?

<xf:submission ...>
    <xf:action ev:event="xforms-submit-error">
        <xf:load resource="/error" show="replace" />
    </xf:action>
</xf:submission>

Martin
Reply | Threaded
Open this post in threaded view
|

Re: best way to show error page on custom submission error

Alessandro  Vernet
Administrator
Hi Martin,

If you don't want the URL to change, I imagine that you could show a dialog with the error message, especially if it makes sense for users to continue to use the page after the error. If not, you could have a the content of your page in a "big" xf:switch / xf:case around the "whole page", and add a xf:case you toggle to in case of error.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: best way to show error page on custom submission error

mabu
Hi Alex,

In my case it is a hard error. So an error dialog makes no sense. Due to the fact that this submission is called for every form (custom-model), I also don't want to implement a "big" xf:switch for every form.
So, I think I will take the solution posted above. Or are there any other ideas?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: best way to show error page on custom submission error

Alessandro  Vernet
Administrator
Martin,

Got it. If you don't want the URL to change, you could also run a <xf:submission replace="all">, instead of doing a <xf:load>. You'll need to make sure the error page accepts a POST, and in that case, what you send to that page doesn't really matter. Could something along those lines work for you?

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: best way to show error page on custom submission error

mabu
Thank's Alex, it sounds good.
So if I understood you correctly, I cannot use the default error pipeline for this scenario?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: best way to show error page on custom submission error

Alessandro  Vernet
Administrator
Martin, correct, the error pipeline would kick only when the browser called Orbeon Forms to retrieve a page, and generating that page somehow failed, while in your case you're running an xf:submission replace="instance".

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