Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

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

Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

ahenket
We are running orbeon-2019.1.0.201910220019-CE.

We have certain pages with an iframe that shows contents based on your selection in the form. This used to work until Orbeon 2019.1.1.

As of Orbeon 2019.1.1, when you visit the page using Apple Safari (macOS Catalina or older, doesn't really seem to matter) you will run into

[Error] java.lang.IllegalStateException: client state not found for form `xforms-form`
rn (orbeon-0b061cc5e595537168f1ee4e1e257234917e9092.js:250:290)
(anonieme functie) (orbeon-0b061cc5e595537168f1ee4e1e257234917e9092.js:251)
(anonieme functie) (orbeon-8cf12d7aec139ed223a6ee0a288f94f5fcb7f1bd.js:227:5371)
(anonieme functie) (orbeon-8cf12d7aec139ed223a6ee0a288f94f5fcb7f1bd.js:227:1539)

After clicking the second and further item. After that the form runs completely inoperable and only a page refresh will get you out of that.

This is not reproducible in FireFox or Chrome so it is browser specific.

I've attached a reproduction page and what it looks like for me as a screen movie.

Is there anything I can do to fix this?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/6161c798-971e-4f4f-954b-d8c6da6eabf9%40googlegroups.com.

iframe.xhtml (4K) Download Attachment
Schermopname 2019-12-19 om 14.09.01.mov (2M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
Hi Alexander,

We had a similar problem with the Test button in Form Builder, which uses an
iframe to show the form you're testing, and updating the `src` on the
`<iframe>` element. It seems to be related to Orbeon Forms now using the
history API (see 1st link below) to store some state about the form. When
the `src` on the `<iframe>` element is changed, Safari loads the new page,
but seems to incorrectly keep the information stored by the previous page.

So in our code for the Test button, we resorted to entirely recreating the
`<iframe>` element in the DOM with JavaScript, instead of just updating the
`src`, which is done in `<xf:action type="javascript"
ev:event="fb-test-form">` (see 2nd link below). I think you could do
something similar in your code, instead of just relying on an AVT for
`instance('class-navigation')`, you'd initially have an `<iframe
src="about:blank">`, and re-create it in a handler for `xforms-enabled
xforms-value-changed` on an `<xf:var value="instance('class-navigation')">`.

You'll let me know if this works for you.

https://developer.mozilla.org/en-US/docs/Web/API/History_API
https://github.com/orbeon/orbeon-forms/blob/tag-release-2019.1-ce/form-builder/jvm/src/main/resources/forms/orbeon/builder/form/model.xml#L652

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1576802189978-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
For reference (mostly my own!), the relevant issues with the Test button
were:

https://github.com/orbeon/orbeon-forms/issues/3900
https://github.com/orbeon/orbeon-forms/issues/4172

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1576802860343-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

ahenket
Interesting. So I’ll file a bug with Apple at least (I have the page online
for them to play with). Maybe it amounts to nothing but one has to try.
Secondly I’ll look into the workarounds over the weekend. Thanks as always!

--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1576850616417-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
Hi Alexander,

I suspect that the best place to file this bug would be
https://bugs.webkit.org. (And I imagine that it would be nice to create a
standalone example that shows this behavior without requiring Orbeon Forms,
in the sense that a simpler example would increase the likelihood that
someone on the WebKit team looks at it.)

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1576866107395-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

ahenket
I filed it with Apple. If it is really the History API in Safari, and since Chrome - also WebKit - works fine, there must be something in Safari itself.

I also tried to follow your workaround but I'm unable to. My first issue seems to be how to call an instance('....') from Javascript, but even then it triggers

Exception in client-side code.
  • Message: undefined is not an object (evaluating 'b.call')

            <xf:action type="javascript" ev:event="xxforms-value-changed" ev:observer="class-navigation">
                alert('Script fired for ' + ORBEON.xforms.Document.getValue("class-navigation"));
               
                var oldIFrame = ORBEON.jQuery('clamlframe');
               
                var newIFrame = document.createElement("IFRAME");
               
                newIFrame.id = oldIFrame.id;
                newIFrame.frameBorder = oldIFrame.frameBorder;
                newIFrame.width = oldIFrame.width;
                newIFrame.height = oldIFrame.height;
                newIFrame.src = "https://decor.nictiz.nl/terminology/claml/ViewClass?classificationId=2.16.840.1.113883.6.3.2&amp;statusCode=active&amp;code=R73.0";
               
                oldIFrame.replaceWith(newIFrame);
            </xf:action>


Any hints appreciated.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/08e5f5dd-94f8-4e4c-a1b4-36a8313ed738%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

ahenket
Just in case, the updated source of the page

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/e1dd1f83-ea64-438f-ba5e-6da582807568%40googlegroups.com.

iframe2.xhtml (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
Hi Alexander,

Sorry for the late response! Regarding the "undefined is not an object"
JavaScript error, to get past this I think you need to attach your
`<xf:action type="javascript">` to a control in the view, hence my
suggestion to put it inside an `<xf:var>`, with the value pointing to what
you're interested, and this in the view.

And to pass a value to the JavaScript code, see the section "Passing
parameters" linked below.
https://doc.orbeon.com/xforms/actions/scripting#passing-parameters

You'll let me know if this works for you.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1578530617869-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
Hi Alexander, did you get a chance to try to call your JavaScript code,
passing a value from XPath, as suggested earlier? If so, you'll let me know
if it worked for you.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579550090707-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

ahenket
Not yet Alessandro. Holiday and post-holiday other work prevented me from doing that. I'm looking into it this week though. The suggested solution is not compatible with Orbeon 3.9 and we have one code base for now. I'll also have to figure out how to implement a conversion switch. Isn't there anything that can be done in Orbeon itself? I.e. like a browser switch or try/catch so Safari doesn't kill the whole form behavior?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/2c19ee5a-e678-484b-9c9a-ed3e42d9b789%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Safari + Orbeon 2019.1.1 + iframe = java.lang.IllegalStateException: client state not found for form `xforms-form`

Alessandro  Vernet
Administrator
Hi Alexander,

So, time to upgrade Orbeon Forms ;), so you can leverage that `<xf:param>`,
and more. Regarding the Safari issue, at the time I looked at it in the
context of the Test button in Form Builder, I couldn't find a workaround
other than recreating the iframe when the page (or the URL) changed. And
since that was a pretty simple workaround, which also worked fine on all
other browsers, we just went ahead with it.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.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 view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1579632428352-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet