|
Re: How to add js for widgets? [message #788865 is a reply to message #788812] |
Thu, 02 February 2012 09:56 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
You won't be able to access the client widgets with jquery just like
that. I'm not sure what you want to do exactly, but i recommand you to
look at http://wiki.eclipse.org/RAP/ClientScripting. This project is in
very early development. Its currently missing Java API, which should be
there in a week or so. After that, any questions or suggestions for this
project are welcome.
greetings,
Tim
Am 02.02.2012 09:59, schrieb sapzqq tyapqz:
> I need to add some script for canvas. I did it like following, but it
> doesn't work.
> code in customize LCA class:
> @Override
> public void renderChanges(Widget widget) throws IOException {
> JavaScriptResponseWriter writer =
> ContextProvider.getStateInfo().getResponseWriter();
> writer
> .write("$('#"
> + WidgetUtil.getId(widget)
> + "').bind('mousewheel', function(event, delta, deltaX, deltaY)
> {alert('wtf!!');});");
>
> ...
> } I have imported jquery and mousewheel plugin. I don't how rap works
> since I can't see any script(for widgets) written by
> JavaScriptResponseWriter on the client. It seems that these scripts(for
> widgets) will be evaluated internally.
> any advice? Thanks for your attention.
|
|
|
Re: How to add js for widgets? [message #788909 is a reply to message #788865] |
Thu, 02 February 2012 11:18 |
sapzqq tyapqz Messages: 8 Registered: February 2012 |
Junior Member |
|
|
Hi Tim
There's no content now in the page you provided. Maybe wait for some time.
What I want to do is to add mousewheel listener to canvas. On RCP, we have a canvas which can be zooming with mousewheel event. This does not support in RAP. So I try to do it myself.
The solution I thought is implementing a customized LCA class for the canvas, adding the mousewheel listener and in the handler of js, sending the request to server(this seems possible).
Do you have any idea about this? Thanks for your reply.
Thanks
[Updated on: Thu, 02 February 2012 11:19] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03807 seconds