Malformed URL with setValue

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

Malformed URL with setValue

Wouter Zelle
Hi,

I have a pageflow that defines three edit pages:

<page id="edit-1" path-info="..." view="..." default-submission="...">
<setvalue parameter="field-on-page1" ref="/form/edit-1/field-on-page1"/>
<setvalue parameter="field-on-page2" ref="/form/edit-2/field-on-page2"/>
<setvalue parameter="field-on-page3" ref="/form/edit-3//field-on-page3"/>
<action ... next/>
</page>
<page id="edit-2" path-info="..." view="..." default-submission="...">
<action ... goto edit-1/>
<action ... next/>
</page>
<page id="edit-3" path-info="..." view="..." default-submission="...">
<action ... goto edit-1/>
<action ... goto edit-2/>
<action ... next/>
</page>

This allows prefilling using url parameters when starting the form. However, when I don't fill in the field on edit-page 1, go to edit-page 2 and then go back to edit-page 1, I get an exception from NetUtils#decodeQueryString:

Malformed URL: %24instance=X2ztn[...]Aqjf0A%3D&field-on-page1=&field-on-page2=&field-on-page3=

The reason for this exception seems to be that Orbeon adds unescaped url parameters to the url with empty values. This exception doesn't happen when going from edit-page 3 to edit-page 2, so it seems that the bug is triggered by a xforms:send to a page with setvalue's. Weirdly enough, this works (except that it obviously doesn't prefill the fields for later edit-pages):

<page id="edit-1" path-info="..." view="..." default-submission="...">
<setvalue parameter="field-on-page1" ref="/form/edit-1/field-on-page1"/>
<action ... next/>
</page>

I don't understand why it would matter if I do a setvalue for a field from the second or third edit-page. Is this a bug or am I using Orbeon incorrectly?

Regards,

Wouter Zelle


--
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: Malformed URL with setValue

Alessandro Vernet
Administrator
Wouter,

Wouter Zelle wrote
I have a pageflow that defines three edit pages:
[...]
It is hard to see exactly what is going on without being able to run the code. Could you create a minimal "app" that we can use to reproduce this? I.e. a few files that you put in your own directory under apps and that we can just put in our environment to reproduce this.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Malformed URL with setValue

Wouter Zelle
Hi Alessandro,

I've attached a small app with two edit-steps and a view-page. There are two street fields, called "street" for edit-page 1 and "street2" for edit-page 2, that can be prefilled. There are also two housenr fields that cannot be prefilled.

Test1:
- Goto /orbeon/address/?street=a&street2=b
- Click on Next until you get to the summary page
- Click on Previous until you get back to the first page
> This works perfectly

Test2:
- Goto /orbeon/address/?street2=b
- Click on Next until you get to the summary page
- Click on Previous until you get back to the first page
> This crashes when going back to the first page

Test3:
- Goto /orbeon/address/?street=a
- Click on Next until you get to the summary page
- Click on Previous until you get back to the first page
> Strangely enough, this works perfectly

Wouter

On Fri, Jun 12, 2009 at 01:55, Alessandro Vernet <[hidden email]> wrote:

Wouter,


Wouter Zelle wrote:
>
> I have a pageflow that defines three edit pages:
> [...]
>

It is hard to see exactly what is going on without being able to run the
code. Could you create a minimal "app" that we can use to reproduce this?
I.e. a few files that you put in your own directory under apps and that we
can just put in our environment to reproduce this.

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Malformed-URL-with-setValue-tp23978844p23990886.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



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

address.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Malformed URL with setValue

Alessandro Vernet
Administrator
Wouter,

Wouter Zelle wrote
I've attached a small app with two edit-steps and a view-page. There are two
street fields, called "street" for edit-page 1 and "street2" for edit-page
2, that can be prefilled. There are also two housenr fields that cannot be
prefilled.
Thank you for the test case! I'll investigate this as soon as I get an chance and get back to you here (if someone doesn't respond to you before that).

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Malformed URL with setValue

Wouter Zelle
Alex,

I managed to get prefilling to work by doing it in the view. On the xforms-model-construct-done event, I do xforms:setvalue's to do prefilling. However, I'm still interested in knowing why it won't work correctly in the pageflow.

Regards,

Wouter Zelle


On Fri, Jun 19, 2009 at 02:22, Alessandro Vernet <[hidden email]> wrote:

Wouter,


Wouter Zelle wrote:
>
> I've attached a small app with two edit-steps and a view-page. There are
> two
> street fields, called "street" for edit-page 1 and "street2" for edit-page
> 2, that can be prefilled. There are also two housenr fields that cannot be
> prefilled.
>

Thank you for the test case! I'll investigate this as soon as I get an
chance and get back to you here (if someone doesn't respond to you before
that).

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
--
View this message in context: http://www.nabble.com/Malformed-URL-with-setValue-tp23978844p24101169.html
Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.



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