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

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: 221
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
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(
	at org.eclipse.swt.SWT.error(
	at org.eclipse.swt.SWT.error(
	at raptest3.GridBody.paintGrid(
	at raptest3.GridBody.paintControl(
	at org.eclipse.swt.widgets.TypedListener.handleEvent(
	at org.eclipse.swt.widgets.EventTable.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Widget.notifyListeners(
	at org.eclipse.swt.widgets.Display.executeNextEvent(
	at org.eclipse.swt.widgets.Display.runPendingMessages(
	at org.eclipse.swt.widgets.Display.safeReadAndDispatch(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.rap.rwt.internal.lifecycle.ProcessAction.execute(
	at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(
	at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(
	at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.executeLifeCycle(
	at org.eclipse.rap.rwt.internal.service.RWTMessageHandler.handleMessage(
	at org.eclipse.rap.rwt.internal.remote.MessageChainElement.handleMessage(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processMessage(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.processUIRequest(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(
	at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(
	at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(
	at org.eclipse.rap.rwt.engine.RWTServlet.doPost(

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: Sun Oct 17 01:57:02 GMT 2021

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

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

Back to the top