Absolutely correct! document('oxf:instance') does access the source page's XForms instance, and the XUpdate code operates on the destination page's XForms instance.

That paragraph was faulty. I checked in a new version of the Tutorial PDF that fixes this.

-Erik

Bill Winspur wrote:

The following code fragment from page 14 of the OXF Tutorial shows how to copy the content
of the ask-name page's form's first-name to the display-name page's form's first name.


<page id="ask-name" path-info="/tutorial-hello4"
xforms="xforms-model.xml"
view="ask-name-view.xhtml">
<action when="/myform/action = 'next'">
<result page="display-name">
<xu:update select="/myform/first-name">
<xu:value-of select="document('oxf:instance')/myform/first-name"/>
</xu:update>
</result>
</action>
</page>


As I understand <xu:update>, its content (picked up in this case by the inner <xu:value-of> element),
replaces the value at the location specified by the <update>'s select attribute.


If this is correct, then in the above fragment:
a) the select attr of the <update> is interpreted against the display-name page's form,
since that is where the data will be inserted, and
b) the select attr of the <value-of> is interpreted against the ask-name page's form,
since that is where the data is obtained.


Again, if I understand xu:update, the following explanation in the tutorial:

/To access the content of this new XForms instance in the display-page, the construct document('oxf:instance') must be used.

/seems wrong, since (from b, above) the construct is apparently used to access the ask-name page.

What is wrong with my argument?

Bill Winspur
Manager, Wynnon Systems Inc
Mobile: 403-519-5889



------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to