Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Send event to server with ClientScripting?
Send event to server with ClientScripting? [message #1753922] Sun, 12 February 2017 21:17 Go to next message
Gerhard Hueller is currently offline Gerhard HuellerFriend
Messages: 2
Registered: February 2017
Junior Member
Hi,

I've written a SWT-Canvas-based server-side widget which uses a little bit of client scripting in order to receive MouseMotion events and handle them with low latency.

Is there any way to communicate (call method on the server-side object) from the client script with the server-side object?

If this is not possible, would it be possible to send javascript-data to the server-side on MouseUp? For now I've only discovered setData/getData which works for server->client data transfer, I am still unaware of a method for client->server data transfer.

Help would be highly appreciated.

Best regards, Gerhard
Re: Send event to server with ClientScripting? [message #1754016 is a reply to message #1753922] Mon, 13 February 2017 19:41 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 206
Registered: February 2011
Senior Member
Have a look at rap.getRemoteObject()
It's in rap.js in the rwt bundle
Also look at rwt/remote/RemoteObject.js

https://wiki.eclipse.org/RAP/Custom_Widgets_FAQ
Re: Send event to server with ClientScripting? [message #1754173 is a reply to message #1754016] Tue, 14 February 2017 23:47 Go to previous message
Gerhard Hueller is currently offline Gerhard HuellerFriend
Messages: 2
Registered: February 2017
Junior Member
Hi Chris,

Thanks a lot for your help.

I had a look at rap.getRemoteObject(), however for Widgets managed by RAP the only thing I get when using RWT scripting are CompositeProxy-Objects.
Is there any way to get the "real" client-side Composite-Object from a CompositeProxy?

For now I created my own RemoteObject, because it is not managed by RAP it doesn't get proxied, and I get the real RemoteObject when using rap.getRemoteObject();
I use this remote-object to call an OperationHandler, however when I try to invoke the redraw()-method on the widget I would like to update, I get:

org.eclipse.swt.SWTException: Graphic is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3708)
	at org.eclipse.swt.SWT.error(SWT.java:3631)
	at org.eclipse.swt.SWT.error(SWT.java:3602)
	at org.eclipse.swt.graphics.GC.checkDisposed(GC.java:1698)
	at org.eclipse.swt.graphics.GC.setBackground(GC.java:289)
	at raptest3.GridBody.paintGrid(GridBody.java:254)
	at raptest3.GridBody.paintControl(GridBody.java:92)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:109)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:687)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:594)
	at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1217)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1198)
	at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1181)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1173)
	at org.eclipse.rap.rwt.internal.lifecycle.ProcessAction.execute(ProcessAction.java:29)
	at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:38)
	at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:46)
	at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.executeLifeCycle(RWTMessageHandler.java:57)
	at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.handleMessage(RWTMessageHandler.java:41)
	at org.eclipse.rap.rwt.internal.remote.MessageChainElement.handleMessage(MessageChainElement.java:29)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processMessage(LifeCycleServiceHandler.java:128)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processUIRequest(LifeCycleServiceHandler.java:100)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:75)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:66)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:135)
	at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:117)
	at org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:107)


Is this to be expected, or should I file a bug report?

Best regards, Gerhard
Previous Topic:Testing web.xml filters from IDE launch
Next Topic:eclipse RAP + chartjs
Goto Forum:
  


Current Time: Wed Oct 24 03:43:51 GMT 2018

Powered by FUDForum. Page generated in 0.02087 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top