Orbeon does not detect changes to a textarea which are made by javascript

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

Orbeon does not detect changes to a textarea which are made by javascript

David McIntyre
I've been trying to use javascript to modify the text in a textarea, but it seems that Orbeon does not recognise the changed value.

I've attached a simple example to illustrate the problem in the sandbox.

Is there something I can do to get Orbeon to recognise that the value has changed, for example by explicitly dispatching a valueChanged event to the textarea?

Dave McIntyre


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

textarea-javascript.xhtml (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon does not detect changes to a textarea which are made by javascript

fl.schmitt(ops-users)
Hi Dave,

> Is there something I can do to get Orbeon to recognise that the value
> has changed, for example by explicitly dispatching a valueChanged event
> to the textarea?

The easiest way is to use the ORBEON.xforms.Document.setValue() function:

http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value

I've attached a modified version of your example.

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

textarea-javascript.xhtml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Orbeon does not detect changes to a textarea which are made by javascript

David McIntyre
Hi again,

Thanks for your suggestion.  Unfortunately it's not going to be quite as
simple in the case I've got in mind.  The problem is that the javascript
which alters the value of the textarea comes from a common component
which is shared between pages which use Orbeon and ones which do not.  
So I could modify the javascript to dispatch a specific event to the
textarea, but I can't invoke the Orbeon method directly within the
javascript.  I think this means that I have two choices:
* dispatch some custom event to the textarea, and have a listener on the
textarea for that event which calls setValue() appropriately
* dispatch the appropriate event to the textarea (keyup? valuechanged?)
so that Orbeon realises that it needs to update the value in the
instance data

Thanks again,

Dave Mc

Florian Schmitt wrote:

> Hi Dave,
>
>> Is there something I can do to get Orbeon to recognise that the value
>> has changed, for example by explicitly dispatching a valueChanged
>> event to the textarea?
>
> The easiest way is to use the ORBEON.xforms.Document.setValue() function:
>
> http://www.orbeon.com/ops/doc/reference-xforms-2#xforms-javascript-get-set-value 
>
>
> I've attached a modified version of your example.
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Orbeon does not detect changes to a textarea which are made by javascript

Alessandro Vernet
Administrator
Dave,

On Wed, Apr 30, 2008 at 4:53 PM, Dave McIntyre
<[hidden email]> wrote:
>  * dispatch the appropriate event to the textarea (keyup? valuechanged?) so
> that Orbeon realises that it needs to update the value in the instance data

Like Florian said, the best way would be to use
ORBEON.xforms.Document.setValue(). But if you can't do this and really
need to dispatch an event, you can try to dispatch a "change" event.
You'll let us know how this works for you.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet


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