error dialog usage

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

error dialog usage

mabu
Hi,

I read in the documentation http://doc.orbeon.com/xforms/error-handling.html that the error dialog is shown if:

1.) fatal javascript errors occur
2.) recoverable server errors occur

Due to the fact that by default the property oxf.xforms.show-recoverable-errors = 0 enumeration point 2.) doesn't trigger the error dialog. Is that correct?
What do you mean by fatal javascript error?
Can you please give me an example when the dialog is shown?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

Alessandro  Vernet
Administrator
Hi Martin,

For instance with:

<xf:trigger>
    <xf:label>Produce error</xf:label>
    <xf:action event="DOMActivate" type="javascript">
        callingFunctionThatDoesntExist()
    </xf:action>
</xf:trigger>

Click on the button, and in the dialog you'll see the following: "Exception in client-side code. Message: callingFunctionThatDoesntExist is not defined".

And of course, it could happen because of a bug in Orbeon Forms, where based on what the server tells us, we try to do a change to the DOM on the browser, but somehow fail to do so for some unforeseen reason.

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

Re: error dialog usage

mabu
Hi Alex,

I tried your example but it didn't work for me. I see this exception in the log if I enable debug logging.

Another question for me is why is there an error page and an error dialog? Why not always showing an error page? Is there a possibility to configure this?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

Alessandro  Vernet
Administrator
Hi Martin,

Sorry, it is because running JavaScript with <xf:action type="javascript"> is the new standard XForms way of invoking JavaScript, and it is coming up in 4.11. Instead, with earlier builds, you need to use <xxf:script>. You'll let us know if this works for you.

The error dialog is to show errors happening when handling Ajax responses, while the error page is produced by the server, if there is an error when the page is first produced.

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

Re: error dialog usage

mabu
Hi Alex,

Using <xxf:script> I see in the developer tools console "Uncaught ReferenceError: callingFunctionThatDoesntExist is not defined" but the error dialog does not pop up.

In the log there is no error.

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

Alessandro  Vernet
Administrator
Hi Martin,

I suspect that this is because at some point the code that was showing the dialog was commended out by mistake, and as a result 4.9 and 4.10 didn't show it. This issue has been fixed for version 4.11.

https://github.com/orbeon/orbeon-forms/commit/2a87bcdae56da12afc59f08c0192b00624240cf6

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

Re: error dialog usage

mabu
Hi Alex,

Ok, thank you for the information. I will try again after release of 4.11.

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

mabu
It is still not working with the current 2016.1 release.

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

Alessandro  Vernet
Administrator
Hi Martin,

What exactly isn't working? Would you have an example that I can run here to reproduce the problem you're seeing?

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

Re: error dialog usage

mabu
Hi Alex,

The ajax error dialog does not show up if I click on the button in this simple form.
I get following error in the developer tools console: Uncaught ReferenceError: callingFunctionThatDoesntExist is not defined

Martin
Reply | Threaded
Open this post in threaded view
|

Re: error dialog usage

Alessandro  Vernet
Administrator
Martin, got it, I will try to reproduce the issue, and will follow-up here once I know more about it.

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

Re: error dialog usage

Alessandro  Vernet
Administrator
Hi Martin,

Indeed, that was fixed, and regressed again. I fixed it again. Thank you for letting us know about it!

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

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