Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to do a Synchronous call to custom widgets java backend
icon5.gif  How to do a Synchronous call to custom widgets java backend [message #1115422] Tue, 24 September 2013 05:11 Go to next message
Christian Hager is currently offline Christian HagerFriend
Messages: 53
Registered: July 2009
Location: Germany
Member
Hi,

I'm currently developing a custom widget and I was wondering how I could implement a synchronous call to the java backend. I'm trying to implement a lazy loading method which is triggered by the JS widget itself. I thought about using remoteObject's call method but I fail to see how I can get the newly loaded data back to the client-side.

Could anyone here please give me any hints on how to do this?


Thanks in advance for any hints or help.


Christian
Re: How to do a Synchronous call to custom widgets java backend [message #1115530 is a reply to message #1115422] Tue, 24 September 2013 08:12 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

Synchronous calls are intentionally not possible with the RAP JavaScript
API. If I understand your usecase correctly, you will have to use a
callback pattern, e.g.:

client:
remoteObject.call( "sendMeData" );

server: (in OperatinoHandler.handleCall )
remoteObject.call( "sendMeDataCallback", mapWithDataObject );

If you need to need to specify which data to load you can add an
argument to the client->server call and loop it back to the
server->client call (in addition to the actual data).

Does that solve your problem?

Greetings,
Tim


Am 24.09.2013 07:11, schrieb Christian Hager:
> Hi,
>
> I'm currently developing a custom widget and I was wondering how I could
> implement a synchronous call to the java backend. I'm trying to
> implement a lazy loading method which is triggered by the JS widget
> itself. I thought about using remoteObject's call method but I fail to
> see how I can get the newly loaded data back to the client-side.
>
> Could anyone here please give me any hints on how to do this?
>
>
> Thanks in advance for any hints or help.
>
>
> Christian

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to do a Synchronous call to custom widgets java backend [message #1116726 is a reply to message #1115530] Wed, 25 September 2013 19:29 Go to previous message
Christian Hager is currently offline Christian HagerFriend
Messages: 53
Registered: July 2009
Location: Germany
Member
Yes that solves my problem. Thanks.
Previous Topic:Table - behaviour of showColumn
Next Topic:SWTException in CoolBarManager on disposed CoolItem
Goto Forum:
  


Current Time: Thu Apr 25 12:45:09 GMT 2024

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

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

Back to the top