Re: Calculated xf:load

--- Alexander Berezhnoy <alexander.berezhnoy@splc.ru> wrote:
> I need to have load action, which redirects to the URL which is 
> dynamically calculated by form current instance attributes.
> 
> What is the common solution?

Hi Alexander,

(1) You can use a <xforms:model nodeset="/to/url" calculate="..."/> to
create the URL with an XPath expression based on other values in the
instance. Then you can refer to that node in your <xforms:load
ref="/to/url"/>.

(2) Alternatively, you might want to leave the page navigation logic
outside of the XForms code. In this scenario, the XForms code will submit
the instance to a URL which is always the same. Then on the server you
figure out based on the content of the instance what the next page should
be and respond with a redirect to that page.

This is an architectural choice, and it might influenced by the complexity
of the server-side code you have to write to implement the second method.
The Orbeon PresentationServer (OPS) Ajax implementation of XForms comes
with a component (which is outside of the scope of the XForms
specification) that lets you declare the page navigation logic in an XML
file, so we tend to prefer the second method.

Alex

--
Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/

Received on Tuesday, 19 July 2005 19:27:13 UTC