relevant removes element from input:instance

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

relevant removes element from input:instance

Wouter Zelle
Hi,

I've got a page with a default-submission like so:

<page path-info="/edit" default-submission="default-submission.xml" view="view.xhtml">
 
<action ....go to next page/>
</page>

The
default-submission file has got two fields:

<form>
 <field1/>
 <field2/>
</form>

In the model of the view there is a binding:

<xforms:bind nodeset="/form/field2" relevant="/form/field1[. = 'true']" />

Field1 is a select1, that can have the value true or false. If it is true, field2 has to be shown (this is an input). This works correctly. However, when going to the next page when field1=false, the empty field2 element is removed from the input:instance (the xforms-instance-inspector shows me this). We have a 'back'-button on the second page and if you go back to the first page, changing field1 to true will no longer show field2, because the corresponding element is missing from the input:instance.

Why is the
field2 element removed from input:instance? Is this a bug?

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: relevant removes element from input:instance

Alessandro Vernet
Administrator
Wouter,

Wouter Zelle wrote
Why is the field2 element removed from input:instance? Is this a bug?
This is a feature. According the XForms specification, non-relevant nodes are pruned from the instance before submission. You can add the attribute relevant="true" to your <xforms:submission> to make sure that non-relevant nodes are sent.

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: re levant removes element from input:instance

Wouter Zelle
Hi Alex,

That didn't work,  but relevant="false" did. Kind of weird that they didn't use the attribute name 'strip-relevant', which would be less confusing.

Anyway, it works, so thanks for your help.

Regards,

Wouter Zelle
~Java Developer~

Iprofs BV.
www.iprofs.nl


On Wed, Jun 24, 2009 at 23:22, Alessandro Vernet <[hidden email]> wrote:

Wouter,


Wouter Zelle wrote:
>
> Why is the field2 element removed from input:instance? Is this a bug?
>

This is a feature. According the XForms specification, non-relevant nodes
are pruned from the instance before submission. You can add the attribute
relevant="true" to your <xforms:submission> to make sure that non-relevant
nodes are sent.

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/relevant-removes-element-from-input%3Ainstance-tp24189275p24193154.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
Reply | Threaded
Open this post in threaded view
|

Re: Re: re levant removes element from input:instance

Alessandro Vernet
Administrator
Wouter,

Wouter Zelle wrote
That didn't work,  but relevant="false" did. Kind of weird that they didn't
use the attribute name 'strip-relevant', which would be less confusing.
That is right: I should have said that you need to use relevant="false". And indeed, I completely agree: the name is quite confusing!

Alex