Re: Access to arguments

We use that extension function constantly, to pass defaults and/or id’s to fetch the instance data using submissions. So we are in favour of standardising this (but it is probably a bit late for XForms 2.0)

Kind regards,

Nick Van den Bleeken
R&D Manager

Phone: +32 3 425 41 02
Office fax: +32 3 821 01 71
nick.van.den.bleeken@inventivegroup.com<mailto:nick.van.den.bleeken@inventivegroup.com>
www.inventivedesigners.com


[cid:image001.png@01CBF2F8.1DA19110][cid:image002.png@01CBF2F8.1DA19110][cid:image003.png@01CBF2F8.1DA19110]

On 19 Mar 2014, at 17:37, Erik Bruchez <erik@bruchez.org<mailto:erik@bruchez.org>> wrote:

Oh and yes I prefer a function to an instance.

-Erik

On Wed, Mar 19, 2014 at 9:35 AM, Erik Bruchez <erik@bruchez.org<mailto:erik@bruchez.org>> wrote:
We have extensions functions for that:

   http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-HTTP-request-functions

For your use case we have:

   xxf:get-request-parameter()

That sounds a bit server-side as an API name though.

BTW browsers have Window.location and Document.location which return
Location objects, but there doesn't seem to be anything to parse the
query string:

https://developer.mozilla.org/en-US/docs/Web/API/Location

-Erik

On Wed, Mar 19, 2014 at 8:12 AM, Steven Pemberton
<Steven.Pemberton@cwi.nl> wrote:
I have a need to access the arguments given to a the URL that causes an
XForm to load.

       http://www.example.com/form.xml?type=1&name=foo

One option would be a pseudo-instance:

       <setvalue ref="bar" value="instance('arguments')/name)" />

but I imagine it would be easier to implement a function:

       <setvalue ref="bar" value="argument('name')" />

Any opinions?

Steven Pemberton






________________________________

Inventive Designers' Email Disclaimer:
http://www.inventivedesigners.com/email-disclaimer

Received on Thursday, 20 March 2014 10:53:08 UTC