Two model instances:
<f:instance id="accesscontrol-instance"> <paswoord/> </f:instance> <f:instance id="message-instance"> <message/> </f:instance> One submission of one instance ('accesscontrol-instance') to replace the other one (message-instance). <f:submission id="accesscontrol-submission" ref="instance('accesscontrol-instance')" action="/spil-edit/access-control" method="post" replace="instance" instance="message-instance"> The action is mapped to access-control.xpl <page path-info="/spil-edit/access-control"> <action action="services/access-control.xpl"/> </page> which does nothing more than: <p:param name="instance" type="output"/> <p:processor name="oxf:identity"> <p:input name="data"> <message>true</message> </p:input> <p:output name="data" ref="instance"/> </p:processor> But message-instance doesn't seem to get updated. What am I missing? Paul -- 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 |
Paul,
The action output isn't copied into the data reply to the page. You should be using <page path-info="/blah" model="path/to.xpl"/> Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: [hidden email] [mailto:[hidden email]] >Sent: 06 November 2006 16:37 >To: [hidden email] >Subject: [ops-users] submission with replace not working > >Two model instances: > ><f:instance id="accesscontrol-instance"> > <paswoord/> ></f:instance> > ><f:instance id="message-instance"> > <message/> ></f:instance> > >One submission of one instance ('accesscontrol-instance') to >replace the other one (message-instance). > ><f:submission id="accesscontrol-submission" >ref="instance('accesscontrol-instance')" >action="/spil-edit/access-control" >method="post" >replace="instance" >instance="message-instance"> > >The action is mapped to access-control.xpl <page >path-info="/spil-edit/access-control"> > <action action="services/access-control.xpl"/> ></page> > >which does nothing more than: > > <p:param name="instance" type="output"/> > > <p:processor name="oxf:identity"> > <p:input name="data"> > <message>true</message> > </p:input> > <p:output name="data" ref="instance"/> </p:processor> > > >But message-instance doesn't seem to get updated. > >What am I missing? > > >Paul > > > > > -- 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 |
The missing piece was adding
<p:processor name="oxf:xml-serializer"> <p:input name="data" href="#message"/> <p:input name="config"> <config> <content-type>text/xml</content-type> </config> </p:input> </p:processor> in the XPL file. However still have following questions and issues: a) I'm not really understanding when this xml-serialising processor is needed. b) I can access now <f:instance id="message-instance"> <message>true</message> <-- generated by xpl </f:instance> with <f:group ref="instance('message-instance')"> <h:p>Message <f:output ref="/message"/> </h:p> </f:group> However if I want to do something analogue in following context <f:action ev:event="xforms-submit-done"> <f:action if="instance('message-instance')/message = 'true'"> <f:toggle case="case1"/> </f:action> I do not seem to get access to the instance. Still confused. -- 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 |
Administrator
|
Paul,
> The missing piece was adding > <p:processor name="oxf:xml-serializer"> > <p:input name="data" href="#message"/> > <p:input name="config"> > <config> > <content-type>text/xml</content-type> > </config> > </p:input> > </p:processor> > in the XPL file. > > However still have following questions and issues: > a) I'm not really understanding when this xml-serialising processor is needed. The page model does not automatically take care of serialization. If you want to send a result to the client directly from a page model, then you need to use a serializer as you have done above. A page view on the other hand (hence the name "view") will automatically serialize data produced on its "data" output through the epilogue pipeline. (Note that strictly speaking, oxf:xml-serializer is deprecated and you are meant to use instead oxf:xml-converter + oxf:http-serializer.) > b) I can access now > > <f:instance id="message-instance"> > <message>true</message> <-- generated by xpl > </f:instance> > > > with > > <f:group ref="instance('message-instance')"> > <h:p>Message <f:output ref="/message"/> > </h:p> > </f:group> > > However if I want to do something analogue in following context > > <f:action ev:event="xforms-submit-done"> > <f:action if="instance('message-instance')/message = 'true'"> > <f:toggle case="case1"/> > </f:action> > > I do not seem to get access to the instance. See Alex's recent blog post: http://www.orbeon.com/blog/2006/11/05/xpath-hack-tip-trick-doc-document-node/ instance('message-instance') returns a document element, not a document node. So just write: if="instance('message-instance') = 'true'" -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 |
Free forum by Nabble | Edit this page |