Re: Model inside the view

Posted by Erik Bruchez on
URL: https://discuss.orbeon.com/Model-inside-the-view-tp26923p26926.html

Tania,

Tania Magnenat wrote:
 > Hi Erik!
 > Thank you for your help, I read the documentation but this doesn't solve
 > my problem.
 >
 > I send you some files that you can test on your computer.

The first thing is that you should not have an "xforms" attribute on
your pages below, otherwise you are still using XForms Classic. Sure,
you can mix and match Classic and NG within an application, however this
quickly becomes confusing!

This said, your submission is actually working as expected: your
formInsideView-travel2 page does get the submission as produced by the
action in formInsideView2. However, your XForms view will not
automatically include that submission. After all, it's just an XML file,
right, and you provide a static XForms instance inside. What you want to
do is initialize the instance from the current XForms submission. You
can do this with XSLT or XInclude, as per:

 
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-instance-initialization



For example, in formInsideView2/travel/view.xhtml, do:

<xforms:instance>
   <xi:include href="input:instance"/>
</xforms:instance>

Or, with XSLT:

<xforms:instance>
   <xsl:copy-of select="doc('input:instance')/*"/>
</xforms:instance>

Note that using XInclude is the preferred way, is it is more efficient.

-Erik



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws