problem with id attribute in xforms:input in 3.0 ?

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

problem with id attribute in xforms:input in 3.0 ?

Doug Young

 

 

Hi,

  I am trying to use java script to set a value in a 3.0 xforms page.

 

  The user activates the java script from a link on the page and when its done the java script uses the id attribute of the xforms:input to set the value of the xfroms:input.

 

The javascript code sets the contents of the input OK but the change is not carried through to the instance that the input is bound to.

When the user types in the input box it works OK.

 

This worked OK in 2.8 and I was guessing it was something to do with the fact that in 3.0 OPS sets the IDs of the inputs.

 

I have a attached simplified  page and java script files. That show the problem. To run it you will need to rename the script file from examp.script to examp.js.

 

Any ideas or work arounds ?

 

Doug Young

Software Engineer

 

Teleflex IT

1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP

+44 (0) 1506 407107

 



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

view.xsl (1K) Download Attachment
examp.script (339 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problem with id attribute in xforms:input in 3.0 ?

Alessandro  Vernet
Administrator
Hi Doug,

The <xforms:input> control can be represented either as a text field
or as calendar widget, depending on the type of the node that control
is bound to. That type can change dynamically (i.e. after the page is
loaded), so when the page is generated the HTML for both the text
field and the calendar widget are included in the HTML and they will
be displayed/hidden at runtime as necessary.

Because of this, the actual HTML input field does not have the id you
expecteda. Interoperability with custom JavaScript is important, so I
will investigate this and send another reply with more information.

Alex

On 11/1/05, Doug Young <[hidden email]> wrote:

>
>
>
>
>
>
>
> Hi,
>
>   I am trying to use java script to set a value in a 3.0 xforms page.
>
>
>
>   The user activates the java script from a link on the page and when its
> done the java script uses the id attribute of the xforms:input to set the
> value of the xfroms:input.
>
>
>
> The javascript code sets the contents of the input OK but the change is not
> carried through to the instance that the input is bound to.
>
> When the user types in the input box it works OK.
>
>
>
> This worked OK in 2.8 and I was guessing it was something to do with the
> fact that in 3.0 OPS sets the IDs of the inputs.
>
>
>
> I have a attached simplified  page and java script files. That show the
> problem. To run it you will need to rename the script file from examp.script
> to examp.js.
>
>
>
> Any ideas or work arounds ?
>
>
>
> Doug Young
>
> Software Engineer
>
>
>
> Teleflex IT
>
> 1 Michaelson Square
>  Livingston
>  West Lothian
>  Scotland
>  EH54 7DP
>
>
> +44 (0) 1506 407107
>
>
>
> --
> 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
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
>

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



--
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
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: problem with id attribute in xforms:input in 3.0 ?

Alessandro  Vernet
Administrator
Hi Doug,

We now support what you are trying to do in our latest code. I just
checked that in so it will be available in the next "unstable build".
For reference, see the attached example, which is a slightly modified
version of your example. You have an input control with
id="facilityID":

<xforms:input ref="ID" id="facilityID">

Then in JavaScript you set the value of this input with:

document.getElementById("facilityID").value = "34"

When this code runs, our JavaScript code notices that you are
programmatically modifying a value, it sends an event to the server,
and other controls bound to the same node are updated. Note that this
currently only works for the <xforms:input> control. But the hard code
is there, and I will leave making this work for other controls to
myself as an exercise for a later time :).

Alex

On 11/1/05, Alessandro Vernet <[hidden email]> wrote:

> Hi Doug,
>
> The <xforms:input> control can be represented either as a text field
> or as calendar widget, depending on the type of the node that control
> is bound to. That type can change dynamically (i.e. after the page is
> loaded), so when the page is generated the HTML for both the text
> field and the calendar widget are included in the HTML and they will
> be displayed/hidden at runtime as necessary.
>
> Because of this, the actual HTML input field does not have the id you
> expecteda. Interoperability with custom JavaScript is important, so I
> will investigate this and send another reply with more information.
>
> Alex
>
> On 11/1/05, Doug Young <[hidden email]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> >   I am trying to use java script to set a value in a 3.0 xforms page.
> >
> >
> >
> >   The user activates the java script from a link on the page and when its
> > done the java script uses the id attribute of the xforms:input to set the
> > value of the xfroms:input.
> >
> >
> >
> > The javascript code sets the contents of the input OK but the change is not
> > carried through to the instance that the input is bound to.
> >
> > When the user types in the input box it works OK.
> >
> >
> >
> > This worked OK in 2.8 and I was guessing it was something to do with the
> > fact that in 3.0 OPS sets the IDs of the inputs.
> >
> >
> >
> > I have a attached simplified  page and java script files. That show the
> > problem. To run it you will need to rename the script file from examp.script
> > to examp.js.
> >
> >
> >
> > Any ideas or work arounds ?
> >
> >
> >
> > Doug Young
> >
> > Software Engineer
> >
> >
> >
> > Teleflex IT
> >
> > 1 Michaelson Square
> >  Livingston
> >  West Lothian
> >  Scotland
> >  EH54 7DP
> >
> >
> > +44 (0) 1506 407107
> >
> >
> >
> > --
> > 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
> > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
> >
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/
>

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


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

view.xsl (1K) Download Attachment
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: problem with id attribute in xforms:input in 3.0 ?

Doug Young
Hi Alex,

Yip the problem is fixed in the unstable build from this morning.


Many Thanks
Doug


Doug Young
Software Engineer
 
Teleflex IT
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
+44 (0) 1506 407107

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro
Vernet
Sent: 02 November 2005 01:01
To: [hidden email]
Subject: Re: [ops-users] problem with id attribute in xforms:input in 3.0 ?

Hi Doug,

We now support what you are trying to do in our latest code. I just
checked that in so it will be available in the next "unstable build".
For reference, see the attached example, which is a slightly modified
version of your example. You have an input control with
id="facilityID":

<xforms:input ref="ID" id="facilityID">

Then in JavaScript you set the value of this input with:

document.getElementById("facilityID").value = "34"

When this code runs, our JavaScript code notices that you are
programmatically modifying a value, it sends an event to the server,
and other controls bound to the same node are updated. Note that this
currently only works for the <xforms:input> control. But the hard code
is there, and I will leave making this work for other controls to
myself as an exercise for a later time :).

Alex

On 11/1/05, Alessandro Vernet <[hidden email]> wrote:

> Hi Doug,
>
> The <xforms:input> control can be represented either as a text field
> or as calendar widget, depending on the type of the node that control
> is bound to. That type can change dynamically (i.e. after the page is
> loaded), so when the page is generated the HTML for both the text
> field and the calendar widget are included in the HTML and they will
> be displayed/hidden at runtime as necessary.
>
> Because of this, the actual HTML input field does not have the id you
> expecteda. Interoperability with custom JavaScript is important, so I
> will investigate this and send another reply with more information.
>
> Alex
>
> On 11/1/05, Doug Young <[hidden email]> wrote:
> >
> >
> >
> >
> >
> >
> >
> > Hi,
> >
> >   I am trying to use java script to set a value in a 3.0 xforms page.
> >
> >
> >
> >   The user activates the java script from a link on the page and when
its
> > done the java script uses the id attribute of the xforms:input to set
the
> > value of the xfroms:input.
> >
> >
> >
> > The javascript code sets the contents of the input OK but the change is
not

> > carried through to the instance that the input is bound to.
> >
> > When the user types in the input box it works OK.
> >
> >
> >
> > This worked OK in 2.8 and I was guessing it was something to do with the
> > fact that in 3.0 OPS sets the IDs of the inputs.
> >
> >
> >
> > I have a attached simplified  page and java script files. That show the
> > problem. To run it you will need to rename the script file from
examp.script

> > to examp.js.
> >
> >
> >
> > Any ideas or work arounds ?
> >
> >
> >
> > Doug Young
> >
> > Software Engineer
> >
> >
> >
> > Teleflex IT
> >
> > 1 Michaelson Square
> >  Livingston
> >  West Lothian
> >  Scotland
> >  EH54 7DP
> >
> >
> > +44 (0) 1506 407107
> >
> >
> >
> > --
> > 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
> > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
> >
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/
>

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




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