Javascript on xforms buttons

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

Javascript on xforms buttons

Shaw, Richard A
Javascript on xforms buttons

Is it possible to have javascript on an Xforms button ?

We are using OPS in a portlet (Liferay) and when the user presses an Xforms button on the page we run a pipeline to write a message to an SQLMessageStore which is telling one of the other portlets on the page to display something. In order to get the other portlet to receive the message we need to refresh the browser view, the easiest way to do this is run a bit of javascript with "parent.refresh()" in it, so we need an xforms button (trigger) to run the pipeline and javascript to cause the refresh.

Richard Shaw

¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤

Richard Shaw  
Technical Design Authority - Information Solutions Consultancy  
Intelligent Transport Systems

Atkins Highways and Transportation
Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW

Tel: +44 (0) 1372 756407 
Fax: +44 (0) 1372 740055
Mob: 07740 817586 
E-mail: [hidden email]

www.atkinsglobal.com/its



This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding.



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

Re: Javascript on xforms buttons

Alessandro  Vernet
Administrator
Richard,

Without a change to PresentationServer, I don't see a good way to do
this. A "hack" could be to do action that changes the DOM in some way
and listen from that modification in JavaScript by adding your own
JavaScript event handler. Say you could set the value of an input
field and use watch on Firefox and the onpropertychange on IE to be
notified when the value property of the input field changes. This is
not very elegant though. Anyone can see another solution?

Otherwise I can a couple a ways in which we could extend the XForms
engine to allow for a JavaScript function to be called.

Alex

On 5/5/06, Shaw, Richard A <[hidden email]> wrote:

>
>
> Is it possible to have javascript on an Xforms button ?
>
> We are using OPS in a portlet (Liferay) and when the user presses an Xforms
> button on the page we run a pipeline to write a message to an
> SQLMessageStore which is telling one of the other portlets on the page to
> display something. In order to get the other portlet to receive the message
> we need to refresh the browser view, the easiest way to do this is run a bit
> of javascript with "parent.refresh()" in it, so we need an xforms button
> (trigger) to run the pipeline and javascript to cause the refresh.
>
> Richard Shaw
>
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤
>
> Richard Shaw
> Technical Design Authority - Information Solutions Consultancy
> Intelligent Transport Systems
>
> Atkins Highways and Transportation
> Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
>
> Tel: +44 (0) 1372 756407
> Fax: +44 (0) 1372 740055
> Mob: 07740 817586
> E-mail: [hidden email]
>
> www.atkinsglobal.com/its
>
>
>
> This email and any attached files are confidential and copyright protected.
> If you are not the addressee, any dissemination of this communication is
> strictly prohibited. Unless otherwise expressly agreed in writing, nothing
> stated in this communication shall be legally binding.
>
> --
> 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