Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ClientScripting callback/messagebox
ClientScripting callback/messagebox [message #1407662] Wed, 13 August 2014 02:42 Go to next message
Eclipse UserFriend
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 02:43] by Moderator

Re: ClientScripting callback/messagebox [message #1412578 is a reply to message #1407662] Tue, 26 August 2014 09:54 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 16:22:14 EDT 2025

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

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

Back to the top