How to capture return value from Javascript

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

How to capture return value from Javascript

SD
Hi All,

How do I capture a return value from Javascript into an instance variable

eg:

<script language="javascript"> function GetClientUTC() { var now = new Date() var offset = now.getTimezoneOffset(); return offset/60; } </script><xxforms:script ev:event="xforms-ready">
        var zone = GetClientUTC();
        <xforms:setvalue ref="instance('clientZone')" value="zone"/>
</xxforms:script>

Kindly help...

regards
--SD
Reply | Threaded
Open this post in threaded view
|

Re: How to capture return value from Javascript

fl.schmitt(ops-users)
Hi,

> How do I capture a return value from Javascript into an instance variable

This is described here:

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-javascript-integration#TOC-Getting-and-Setting-Controls-Value-

In short:
- create a xforms control (usually, a xforms:input bound to the
instance node you want to expose to js);
- put ORBEON.xforms.Document.setValue(myControl, "myValue") into your
javascript to modify that control - the value change will be
propagated to the xforms instance.

If you don't want to expose that "intermediary" xforms control to the
user, just add a style="display:none;" to the control to hide it.


HTH
florian


--
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
SD
Reply | Threaded
Open this post in threaded view
|

Re: Re: How to capture return value from Javascript

SD
Thanks, that was of great help.

On Mon, Mar 21, 2011 at 12:43 PM, Florian Schmitt <[hidden email]> wrote:
Hi,

> How do I capture a return value from Javascript into an instance variable

This is described here:

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-javascript-integration#TOC-Getting-and-Setting-Controls-Value-

In short:
- create a xforms control (usually, a xforms:input bound to the
instance node you want to expose to js);
- put ORBEON.xforms.Document.setValue(myControl, "myValue") into your
javascript to modify that control - the value change will be
propagated to the xforms instance.

If you don't want to expose that "intermediary" xforms control to the
user, just add a style="display:none;" to the control to hide it.


HTH
florian


--
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