re: problem regarding javascript in ops3.5

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

re: problem regarding javascript in ops3.5

richhl
you cannot reach xforms model elements via javascript, u can
only touch xforms control elements (that of course you can
bind with instance nodes). Refer to
http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value

if u don't want to have a visible control, you have a tricky
way of doing what you want by creating a hidden control and
make the javascript code change its value and launch a
custom event that (in xforms realm) changes xforms model
instance value to the one grabbed from hidden control.

regards,

rich
 
----- El siguiente mensaje original  -----
De: "Laxmi Narayana" <[hidden email]>
Para: [hidden email]
Asunto: [ops-users] problem regarding javascript in ops3.5
Fecha: Tue, 18 Mar 2008 18:54:52 +0530

>Hi,
>I am using ops 3.5.1.how to get <dummynumber2> value in
>javascript. my model is like this:
><xforms:model id="main-model">
>         <xforms:instance id="main-instance">
>                 <dummynumber2>10</dummynumber2>
>            </xforms:instance>
></xforms:model>
>
>in save button I written code like this.
>
> <xforms:group>
>     <xforms:action
>ev:event="DOMActivate">
>        <xforms:load resource="javascript:testJS()"/>
>        <xforms:send submission="submit-submission"/>
>          </xforms:action>
>  <trigger....here>
> </xforms:group>
>
>
>in java script I written like this:
>
><xhtml:script language="javascript">
> function testJS()
>        {
>
>alert("hi"+document.getElementById('main-model').getValue('
>dummynumber2'));
>          }
></xhtml:script>
>thanks in advance,
>LaxmiNarayana.
>
>
>[Adjunto: message-footer.txt]


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