Exception in xforms.js

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

Exception in xforms.js

Ralf Jung
Hi list,

I am using Orbeon CE 3.8.0, and I am experiencing weird behaviour wrt upload
controls: I am using an <xforms:upload> control to allow the data to load an
instance that was previously saved (using <xforms:output
appearance="xxforms:download") - thanks a lot for those useful features!
This is the submission dealing with the upload (I mapped the "xf" prefix to the
xforms namespace):
        <xf:submission id="upload-query-submission" ref="instance('upload')"
validate="false"
                        relevant="false" method="post" replace="none" resource="test:">
                  <xf:action ev:event="xforms-submit-done">
                                <xf:insert nodeset="instance('search-query-instance')"
origin="saxon:parse(saxon:base64Binary-to-
string(xs:base64Binary(instance('upload')), 'UTF-8'))"/>
                                <!-- <xf:send submission="search-submission"/> -->
                   </xf:action>
        </xf:submission>
If I now upload a file containing a valid query, the search dialogue is filled
correctly, and if I hit the button which triggers the "search-submission",
everything works as expected (the query is fed through a custom Java
processor, which outputs an XPath condition, that is sent to an eXist DB, and
the reply is a list of matching items). If however I enable that line I
commented out above, and directly send the search-submission after the upload
is finished, I get a very weird error message shown in the client:
    * Message: element is undefined
    * File: http://localhost:8080/roteliste/ops/javascript/xforms.js
    * Line number: 509
That line is the first line of the Orbeon.util.Dom.getStringValue function (I
am using the uncompressed JS to be able to debug this). Firebug reveals that
the element parameter of that function is actually null. The calling function
is handleResponseDom, line 7293 - the "error message" case. The DOM looks
quite complicated in Firebug (maybe there's a special DOM view, don't know),
but I can see the error message comes from Firefox itself (it also shows up in
the error console), and it complains about an "undefined entity" in column 1070
of the response from the XForms server. That entity seems to be &nbsp; -
however, the usual indicator ------^ completely fails here, so I hope I
assembled that correctly in my editor.
Any ideas what could be going on here?

Kind regards,
Ralf Jung


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Exception in xforms.js

Alessandro  Vernet
Administrator
Ralf,

We have greatly improved the upload in the last few months, and those
changes will be in the 3.9 version, to be released soon. If it is
possible for you to upgrade, could you try doing this with a nightly
build, and tell us if it works better for you?

Alex

On Thu, Mar 10, 2011 at 5:06 AM, Ralf Jung <[hidden email]> wrote:

> Hi list,
>
> I am using Orbeon CE 3.8.0, and I am experiencing weird behaviour wrt upload
> controls: I am using an <xforms:upload> control to allow the data to load an
> instance that was previously saved (using <xforms:output
> appearance="xxforms:download") - thanks a lot for those useful features!
> This is the submission dealing with the upload (I mapped the "xf" prefix to the
> xforms namespace):
>        <xf:submission id="upload-query-submission" ref="instance('upload')"
> validate="false"
>                        relevant="false" method="post" replace="none" resource="test:">
>                  <xf:action ev:event="xforms-submit-done">
>                                <xf:insert nodeset="instance('search-query-instance')"
> origin="saxon:parse(saxon:base64Binary-to-
> string(xs:base64Binary(instance('upload')), 'UTF-8'))"/>
>                                <!-- <xf:send submission="search-submission"/> -->
>                   </xf:action>
>        </xf:submission>
> If I now upload a file containing a valid query, the search dialogue is filled
> correctly, and if I hit the button which triggers the "search-submission",
> everything works as expected (the query is fed through a custom Java
> processor, which outputs an XPath condition, that is sent to an eXist DB, and
> the reply is a list of matching items). If however I enable that line I
> commented out above, and directly send the search-submission after the upload
> is finished, I get a very weird error message shown in the client:
>    * Message: element is undefined
>    * File: http://localhost:8080/roteliste/ops/javascript/xforms.js
>    * Line number: 509
> That line is the first line of the Orbeon.util.Dom.getStringValue function (I
> am using the uncompressed JS to be able to debug this). Firebug reveals that
> the element parameter of that function is actually null. The calling function
> is handleResponseDom, line 7293 - the "error message" case. The DOM looks
> quite complicated in Firebug (maybe there's a special DOM view, don't know),
> but I can see the error message comes from Firefox itself (it also shows up in
> the error console), and it complains about an "undefined entity" in column 1070
> of the response from the XForms server. That entity seems to be &nbsp; -
> however, the usual indicator ------^ completely fails here, so I hope I
> assembled that correctly in my editor.
> Any ideas what could be going on here?
>
> Kind regards,
> Ralf Jung
>
>
> --
> 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, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Exception in xforms.js

Ralf Jung
Hi Alex,

no, quite the opposite actually: Not even the previously working loading of
the instance works anymore. At least, not without any code changes. I get the
upload progress bar (which I don't really need, the files uploaded are never
more than 2KiB in size), but the action that's supposed to be taken when the
upload finished is never triggered - the data is not put into the instance. It
just halts after filling the bar to about 10%.
Does the old method of adding
<xf:send ev:event="xforms-select" submission="upload-report-submission"/>
and then taking action in the submission's xforms-submit-done event no longer
work? I can't really produce two different versions of my page, and the target
is definitely a stable Orbeon release, so 3.8 currently.

Kind regards,
Ralf

Am Freitag 11 März 2011, um 21:23:25 schrieb Alessandro Vernet:

> Ralf,
>
> We have greatly improved the upload in the last few months, and those
> changes will be in the 3.9 version, to be released soon. If it is
> possible for you to upgrade, could you try doing this with a nightly
> build, and tell us if it works better for you?
>
> Alex
>
> On Thu, Mar 10, 2011 at 5:06 AM, Ralf Jung <[hidden email]> wrote:
> > Hi list,
> >
> > I am using Orbeon CE 3.8.0, and I am experiencing weird behaviour wrt
> > upload controls: I am using an <xforms:upload> control to allow the data
> > to load an instance that was previously saved (using <xforms:output
> > appearance="xxforms:download") - thanks a lot for those useful features!
> > This is the submission dealing with the upload (I mapped the "xf" prefix
> > to the xforms namespace):
> >        <xf:submission id="upload-query-submission"
> > ref="instance('upload')" validate="false"
> >                        relevant="false" method="post" replace="none"
> > resource="test:"> <xf:action ev:event="xforms-submit-done">
> >                                <xf:insert
> > nodeset="instance('search-query-instance')"
> > origin="saxon:parse(saxon:base64Binary-to-
> > string(xs:base64Binary(instance('upload')), 'UTF-8'))"/>
> >                                <!-- <xf:send
> > submission="search-submission"/> --> </xf:action>
> >        </xf:submission>
> > If I now upload a file containing a valid query, the search dialogue is
> > filled correctly, and if I hit the button which triggers the
> > "search-submission", everything works as expected (the query is fed
> > through a custom Java processor, which outputs an XPath condition, that
> > is sent to an eXist DB, and the reply is a list of matching items). If
> > however I enable that line I commented out above, and directly send the
> > search-submission after the upload is finished, I get a very weird error
> > message shown in the client: * Message: element is undefined
> >    * File: http://localhost:8080/roteliste/ops/javascript/xforms.js
> >    * Line number: 509
> > That line is the first line of the Orbeon.util.Dom.getStringValue
> > function (I am using the uncompressed JS to be able to debug this).
> > Firebug reveals that the element parameter of that function is actually
> > null. The calling function is handleResponseDom, line 7293 - the "error
> > message" case. The DOM looks quite complicated in Firebug (maybe there's
> > a special DOM view, don't know), but I can see the error message comes
> > from Firefox itself (it also shows up in the error console), and it
> > complains about an "undefined entity" in column 1070 of the response
> > from the XForms server. That entity seems to be &nbsp; - however, the
> > usual indicator ------^ completely fails here, so I hope I assembled
> > that correctly in my editor.
> > Any ideas what could be going on here?
> >
> > Kind regards,
> > Ralf Jung
> >
> >
> > --
> > 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


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Exception in xforms.js

Erik Bruchez
Administrator
Ralf,

We have some doc on the differences between 3.8 and 3.9 uploads here:


3.9 no longer dispatches xforms-select, as  the upload now starts automatically. We could have kept xforms-select, but then with existing code that would trigger the "fake" submission hack used in 3.8, and that in turn could cause issues. So we decided instead to not dispatch xforms-select anymore, and to use new events to clearly indicate the start and end of an upload.

It is unfortunate that a code change is needed, but the upload implementation was changed in quite a major way and we are not sure a backward-compatible solution is possible (ideas welcome).

Now back to the original issue: what you say seems to indicate that there is an unescaped &nbsp; in the response, and there probably shouldn't be one.

Can you see with Firebug what's the content of the Ajax or pseudl-Ajax response reaching the client? If not with Firebug, with HTTPScoop or similar:


Or, is there any way we can reproduce this locally?

-Erik

On Sat, Mar 12, 2011 at 3:28 AM, Ralf Jung <[hidden email]> wrote:
Hi Alex,

no, quite the opposite actually: Not even the previously working loading of
the instance works anymore. At least, not without any code changes. I get the
upload progress bar (which I don't really need, the files uploaded are never
more than 2KiB in size), but the action that's supposed to be taken when the
upload finished is never triggered - the data is not put into the instance. It
just halts after filling the bar to about 10%.
Does the old method of adding
<xf:send ev:event="xforms-select" submission="upload-report-submission"/>
and then taking action in the submission's xforms-submit-done event no longer
work? I can't really produce two different versions of my page, and the target
is definitely a stable Orbeon release, so 3.8 currently.

Kind regards,
Ralf

Am Freitag 11 März 2011, um 21:23:25 schrieb Alessandro Vernet:
> Ralf,
>
> We have greatly improved the upload in the last few months, and those
> changes will be in the 3.9 version, to be released soon. If it is
> possible for you to upgrade, could you try doing this with a nightly
> build, and tell us if it works better for you?
>
> Alex
>
> On Thu, Mar 10, 2011 at 5:06 AM, Ralf Jung <[hidden email]> wrote:
> > Hi list,
> >
> > I am using Orbeon CE 3.8.0, and I am experiencing weird behaviour wrt
> > upload controls: I am using an <xforms:upload> control to allow the data
> > to load an instance that was previously saved (using <xforms:output
> > appearance="xxforms:download") - thanks a lot for those useful features!
> > This is the submission dealing with the upload (I mapped the "xf" prefix
> > to the xforms namespace):
> >        <xf:submission id="upload-query-submission"
> > ref="instance('upload')" validate="false"
> >                        relevant="false" method="post" replace="none"
> > resource="test:"> <xf:action ev:event="xforms-submit-done">
> >                                <xf:insert
> > nodeset="instance('search-query-instance')"
> > origin="saxon:parse(saxon:base64Binary-to-
> > string(xs:base64Binary(instance('upload')), 'UTF-8'))"/>
> >                                <!-- <xf:send
> > submission="search-submission"/> --> </xf:action>
> >        </xf:submission>
> > If I now upload a file containing a valid query, the search dialogue is
> > filled correctly, and if I hit the button which triggers the
> > "search-submission", everything works as expected (the query is fed
> > through a custom Java processor, which outputs an XPath condition, that
> > is sent to an eXist DB, and the reply is a list of matching items). If
> > however I enable that line I commented out above, and directly send the
> > search-submission after the upload is finished, I get a very weird error
> > message shown in the client: * Message: element is undefined
> >    * File: http://localhost:8080/roteliste/ops/javascript/xforms.js
> >    * Line number: 509
> > That line is the first line of the Orbeon.util.Dom.getStringValue
> > function (I am using the uncompressed JS to be able to debug this).
> > Firebug reveals that the element parameter of that function is actually
> > null. The calling function is handleResponseDom, line 7293 - the "error
> > message" case. The DOM looks quite complicated in Firebug (maybe there's
> > a special DOM view, don't know), but I can see the error message comes
> > from Firefox itself (it also shows up in the error console), and it
> > complains about an "undefined entity" in column 1070 of the response
> > from the XForms server. That entity seems to be &nbsp; - however, the
> > usual indicator ------^ completely fails here, so I hope I assembled
> > that correctly in my editor.
> > Any ideas what could be going on here?
> >
> > Kind regards,
> > Ralf Jung
> >
> >
> > --
> > 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


--
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




--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Exception in xforms.js

Ralf Jung
Hi Erik,

> We have some doc on the differences between 3.8 and 3.9 uploads here:
>
> http://wiki.orbeon.com/forms/doc/developer-guide/xforms-controls/upload-con
> trol#TOC-With-Orbeon-Forms-3.9
>
> 3.9 no longer dispatches xforms-select, as  the upload now starts
> automatically. We could have kept xforms-select, but then with existing
> code that would trigger the "fake" submission hack used in 3.8, and that
> in turn could cause issues. So we decided instead to not dispatch
> xforms-select anymore, and to use new events to clearly indicate the start
> and end of an upload.
>
> It is unfortunate that a code change is needed, but the upload
> implementation was changed in quite a major way and we are not sure a
> backward-compatible solution is possible (ideas welcome).
I perfectly understand that, and if I had to decide, that's what I had done -
dragging old broken APIs around is always bad. In this case however it means I
can't test this part of my app with the new Orbeon before there is a stable
release with the changed API.

> Now back to the original issue: what you say seems to indicate that there
> is an unescaped &nbsp; in the response, and there probably shouldn't be
> one.
>
> Can you see with Firebug what's the content of the Ajax or pseudl-Ajax
> response reaching the client? If not with Firebug, with HTTPScoop or
> similar:
>
> http://wiki.orbeon.com/forms/doc/developer-guide/admin/monitoring-http-requ
> ests
>
> Or, is there any way we can reproduce this locally?
I would not know how - as I said, I have two upload fields, and for one of
them, triggering the submission when the upload is finished works perfectly
fine.
To make things even more weird: The error is only triggered by some files I
upload. Those files contain a search query that is then executed on the
database, and the character it complains about is part of the list of search
results that gets sent from the server to the form. The error somehow depends
on the set of resulting items. However, in any way, the *same* result set is
transmitted perfectly fine if I do the search the normal way, i.e. without
using an uploaded file.
I will grab a server reply that's causing the error via Wireshark and send it
to you via personal mail.

Kind regards,
Ralf


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Exception in xforms.js

Ralf Jung
In reply to this post by Erik Bruchez
Hi Erik,

> We have some doc on the differences between 3.8 and 3.9 uploads here:
>
> http://wiki.orbeon.com/forms/doc/developer-guide/xforms-controls/upload-con
> trol#TOC-With-Orbeon-Forms-3.9
>
> 3.9 no longer dispatches xforms-select, as  the upload now starts
> automatically. We could have kept xforms-select, but then with existing
> code that would trigger the "fake" submission hack used in 3.8, and that
> in turn could cause issues. So we decided instead to not dispatch
> xforms-select anymore, and to use new events to clearly indicate the start
> and end of an upload.
>
> It is unfortunate that a code change is needed, but the upload
> implementation was changed in quite a major way and we are not sure a
> backward-compatible solution is possible (ideas welcome).
Due to the RC, I've had a look at Orbeon 3.9 again and updated my app to work
with it. Good news: I can not reproduce this problem anymore.

Thanks a lot for all your great work!

Kind regards,
Ralf


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Exception in xforms.js

Erik Bruchez
Administrator
Ralf,

Great, thanks for the positive feedback!

-Erik

On Wed, Mar 23, 2011 at 10:55 AM, Ralf Jung <[hidden email]> wrote:

> Hi Erik,
>
>> We have some doc on the differences between 3.8 and 3.9 uploads here:
>>
>> http://wiki.orbeon.com/forms/doc/developer-guide/xforms-controls/upload-con
>> trol#TOC-With-Orbeon-Forms-3.9
>>
>> 3.9 no longer dispatches xforms-select, as  the upload now starts
>> automatically. We could have kept xforms-select, but then with existing
>> code that would trigger the "fake" submission hack used in 3.8, and that
>> in turn could cause issues. So we decided instead to not dispatch
>> xforms-select anymore, and to use new events to clearly indicate the start
>> and end of an upload.
>>
>> It is unfortunate that a code change is needed, but the upload
>> implementation was changed in quite a major way and we are not sure a
>> backward-compatible solution is possible (ideas welcome).
> Due to the RC, I've had a look at Orbeon 3.9 again and updated my app to work
> with it. Good news: I can not reproduce this problem anymore.
>
> Thanks a lot for all your great work!
>
> Kind regards,
> Ralf
>
>
> --
> 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
>
>


--
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