Is there anyway to have the ref in a setvalue be dynamic?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there anyway to have the ref in a setvalue be dynamic?

mfpaschal
Hi Folks,

A normal setvalue looks something like:
<xforms:setvalue ref="instance('some-instance')" value="..."/>

The value being set is a static definition. Is there anyway to have the reference be dynamic? In other words, could the name of the instance to be set be stored in another instance and referred to indirectly?

Any help most welcome!

Thanks,
Mike Paschal


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to have the ref in a setvalue be dynamic?

fl.schmitt(ops-users)
Hi Mike,

> The value being set is a static definition. Is there anyway to have
> the reference be dynamic? In other words, could the name of the
> instance to be set be stored in another instance and referred to
> indirectly?

this should be possible - take a look at the xxforms:evaluate [1] or
the xxforms:evaluate-avt() [2] functions.

HTH
florian

[1]
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-xxforms:evaluate-
[2]
http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-xxforms:evaluate-avt-


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Is there anyway to have the ref in a setvalue be dynamic?

Erik Bruchez
Administrator
In reply to this post by mfpaschal
It's an XPath expression so it's already pretty dynamic.Try:

<xforms:setvalue ref="instance(instance('foobar')/instance-name)" value="..."/>

-Erik

On Fri, Mar 4, 2011 at 7:59 AM, <[hidden email]> wrote:
Hi Folks,

A normal setvalue looks something like:
<xforms:setvalue ref="instance('some-instance')" value="..."/>

The value being set is a static definition. Is there anyway to have the reference be dynamic? In other words, could the name of the instance to be set be stored in another instance and referred to indirectly?

Any help most welcome!

Thanks,
Mike Paschal


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws




--
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
OW2 mailing lists service home page: http://www.ow2.org/wws