Jos Vos wrote:
In the ATM example, the enter-pin-action.xsl returns a document with a <valid> node (only). That document is used for the <when> checks. Still all as I expect. But I also see that the document with the <valid> node seems to be used as a model for the page when it is displayed again: enter-pin-view.xsl checks "/valid". But I thought a model (XSL input for the view) could only be generetad by a "model=" attribute for a page, and here the output of an action seems to act as a model too. Confused...
Hi Jos,
In general, the output of an action is just used in the page flow to (a) decide where to go next based on the output of the action, and/or (b) update the instance of the current page or target page with data fetched by the action.
Now if an action is executed, its output is also visible to the "data" input of the model (if there is a model, and if the model declares a "data" input parameter). If there is no model, or if the model has no output, the output of the action is available as the "data" input of the view.
Let's come back to the ATM example. In the "enter PIN" page, we assume that the PIN is checked with some business logic. The business logic is in the action, and for this example it is just an XSL file that compares the entered PIN with a given value. Instead of the view displaying an error message based on the output of the action, it is better to use the XForms <xforms:alert> element in the view. Now the password field is:
<xforms:secret ref="pin">
<xforms:alert>Invalid PIN</xforms:alert>
</xforms:secret>And the view is a static XML file (instead of XSLT). The page flow annotates the instance with the xxforms:valid="false" attribute based in the output of the action:
<action when="/form/action = 'submit'"
action="enter-pin-action.xsl">
<result when="/valid = 'true'" page="view-account"/>
<result>
<xu:append select="/form/pin"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<xu:attribute name="xxforms:valid">
false
</xu:attribute>
</xu:append>
</result>
</action>I have modified the ATM example as described above. Let me know Jos if you have any question.
Alex
------------------------------------------------------- This SF.Net email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user
