ClientScripting callback/messagebox [message #1407662] |
Wed, 13 August 2014 06:42 |
Matthias Nick 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 |
Tim Buschtoens 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02802 seconds