Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ClientScripting callback/messagebox
ClientScripting callback/messagebox [message #1407662] Wed, 13 August 2014 06:42 Go to next message
Matthias Nick is currently offline Matthias NickFriend
Messages: 197
Registered: August 2013
Senior Member
Hi,

I added a Verify listener via ClientScripting:

text.addListener(SWT.Verify, new ClientListener(js));


This works fine.

Now I wanted to show a messageBox from the JS code but I am not sure how. Without clientScripting I would use the following code

MessageBox box = new MessageBox(e.display.getActiveShell(), SWT.OK);
box.setText(...);
box.setMessage(...);
box.open();


Can I somehow show the messageBox directly from JS? Alternatively is there a way to register a callback from the javascript to my .java file?

Thanks,
Matthias

[Updated on: Wed, 13 August 2014 06:43]

Report message to a moderator

Re: ClientScripting callback/messagebox [message #1412578 is a reply to message #1407662] Tue, 26 August 2014 13:54 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hmmm.... how about using alert? It's not pretty, but it's simple.


A workaround could be to pre-create the dialog on the server and make it
visible on the client (as you can not create widgets on the client
side), but that won't work with message box, you can only do this with
widgets.

Sadly there is currently no out-of-the-box way to call back to the
server. It *IS* possible with Remote-API, but requires a bit of
overhead. I can give you further hints if you decide what solution you
want to follow.

Greetings,
Tim



Am 13.08.2014 08:42, schrieb Matthias Nick:
> Hi,
>
> I added a Verify listener via ClientScripting:
>
> text.addListener(SWT.Verify, new ClientListener(js));
>
> This works fine.
>
> Now I wanted to show a messageBox from the JS code but I am not sure
> how. Without clientScripting I would use the following code
>
>
> MessageBox box = new MessageBox(e.display.getActiveShell(), SWT.OK);
> box.setText(...);
> box.setMessage(...);
> box.open();
>
>
> Can I somehow show the messageBox directly from JS? Alternatively is
> there a way to register a callback from the javascript to my .java object?
>
> Thanks,
> Matthias

--
Tim Buschtöns

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Deprecation of PhaseListeners
Next Topic:Browser disabled state
Goto Forum:
  


Current Time: Sat Apr 27 03:04:14 GMT 2024

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

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

Back to the top