Home » Eclipse Projects » Remote Application Platform (RAP) » Java applet in browser widget covers modal dialogs
Java applet in browser widget covers modal dialogs [message #996992] |
Thu, 03 January 2013 11:02 |
Tiburon T Messages: 61 Registered: October 2011 |
Member |
|
|
Hello!
I am working on some kind of custom widget, that is composed of a Java Applet embedded in an html page and displayed in a browser widget within an RAP application. The applet and the application communicate via BrowserFunction and JavaScript.
It works quite well, but I have a problem with modal dialogs that should cover parts of the applet. The applet is always displayed on top of everything... If I hide the browser widget by setting its visibility to false everything works fine, so I thought maybe I could do that anytime a modal dialog is shown.
Therefore I am now looking for some kind of event that is sent to the widget or its parent shell when it should get disabled. It is not possible to hide the browser manually for every dialog, because it needs to be done for system dialogs like the session timeout notification as well.
I tried to attach nearly all available listeners including DisposeListener, ShellListener(and ShellAdapter) and PaintListener, but none is called at the right moment.
Am I missing something or is there no such event?
Of course any other idea on how to hide the applet would be highly appreciated, too.
[Updated on: Thu, 03 January 2013 11:03] Report message to a moderator
|
|
|
Re: Java applet in browser widget covers modal dialogs [message #997100 is a reply to message #996992] |
Thu, 03 January 2013 16:48 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
> its parent shell when it should get disabled. It is not possible to hide
> the browser manually for every dialog, because it needs to be done for
> system dialogs like the session timeout notification as well.
When a connection error like session timeout appears, the server has no
more control over the client, therefore i think this is not possible to
properly fix with only Java. We had issues like this before, browser
widgets (and other custom widgets) may render over overlaying elements,
or consume events. (See Bug 370901 [1], which also discusses a possible
fix.)
I think this could be regarded as a bug in RAP, as it is a known browser
limitation that can currently not be worked around by application
developers. I suggest you open a bugzilla entry [2], though i don't
think a change this big will be part of any service release, so you
might have to update if it gets fixed.
Greetings,
Tim
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=370901
[2] http://eclipse.org/rap/bugs/
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Java applet in browser widget covers modal dialogs [message #997188 is a reply to message #997100] |
Fri, 04 January 2013 11:02 |
Tiburon T Messages: 61 Registered: October 2011 |
Member |
|
|
Hello,
thank you for your support Tim.
I did some more research this morning and found the following:
- The problem does not exist in Mozilla Firefox (even menus and regular modal dialogs are drawn over the applet correctly)
- Issues with the z-index of iframes containing flash or applets seem to be very common and the most popular workaround is putting everything that is supposed to be drawn above the iframe in iframes also (iframe shimming)
As a side note: Wouldn't it be a good idea to put at least the timeout notification into its own iframe?
- It is possible to hide the applet by setting the "display" css property to none, which can be done with javascript from within the html-page displayed in the iframe.
The last point would actually fix the issue for us for now, and I am trying to implement a JavaScript function for it. Therefore I am looking for a way to be notified in javascript, when the gray div (z-index 100000) is shown, that is supposed to shadow the page behind the session timeout notification (z-index 100001). Can you give me a hint if there is an event or anything I could attach a new listener to?
Greetings
Tiburon
[Updated on: Fri, 04 January 2013 11:06] Report message to a moderator
|
|
|
Re: Java applet in browser widget covers modal dialogs [message #997620 is a reply to message #997188] |
Fri, 04 January 2013 17:58 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
> As a side note: Wouldn't it be a good idea to put at least the timeout
> notification into its own iframe?
This would be good quickfix for that specific issue, but we can't do
that on all elements that might hover over an iframe.
>
> - It is possible to hide the applet by setting the "display" css
> property to none, which can be done with javascript from withing the
> html-page displayed in the iframe.
That would be the same as hiding the entire browser widget i think.
> The last point would actually fix the issue for us for now, and I am
> trying to implement a function for it. Therefore I am looking for a way
> to be notified in javascript, when the gray div (z-index 100000) is
> shown, that is supposed to shadow the page behind the session timeout
> notification (z-index 100001). Can you give me a hint if there is an
> event or anything I could attach a new listener to?
As i explained, this can only be done in JavaScript, and currently only
with internal API. While i can point you to the right API if you tell me
what RAP version exactly you are using, there are two issues:
a) Using internal API will mean it can break anytime.
b) Once you are notified in javascript, how do you access the browser
widget?
These are the reasons i think the framework has to solve this, or at
least has to provide some sort of workaround.
Greetings,
Tim
> Greetings
> Tiburon
>
>
>
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: Java applet in browser widget covers modal dialogs [message #997717 is a reply to message #996992] |
Tue, 08 January 2013 15:42 |
Tiburon T Messages: 61 Registered: October 2011 |
Member |
|
|
Hi,
Quote:
> The last point would actually fix the issue for us for now, and I am
> trying to implement a function for it. Therefore I am looking for a way
> to be notified in javascript, when the gray div (z-index 100000) is
> shown, that is supposed to shadow the page behind the session timeout
> notification (z-index 100001). Can you give me a hint if there is an
> event or anything I could attach a new listener to?
As i explained, this can only be done in JavaScript, and currently only
with internal API. While i can point you to the right API if you tell me
what RAP version exactly you are using, there are two issues:
a) Using internal API will mean it can break anytime.
b) Once you are notified in javascript, how do you access the browser
widget?
It would be great if you could point me to the event for RAP 1.5.0.20120612-1510. It is not necessary to access the browser widget. The Java applet is embedded in a HTML document which is displayed inside the browser. In this document I can hide the applet using the CSS property display, which can be changed dynamically with JavaScript. Here is a small example:
<html>
<head>
<title>...</title>
</head>
<body style="overflow:hidden">
<embed id="applet" style = "display:block;"
...
/>
<script type="text/javascript">
hideApplet = function hideApplet(){
document.getElementById('applet').style.display = 'none';
};
</script>
</body>
</html>
I am aware, that this is just a quick fix that can break anytime soon, but it would really help if I could implement it without changing to a newer version immediately.
I would be happy to provide a bug report and hope for a better solution in a future version.
Greeting
Tiburon
|
|
|
Re: Java applet in browser widget covers modal dialogs [message #997810 is a reply to message #997717] |
Tue, 08 January 2013 19:41 |
Zach Toups Messages: 1 Registered: January 2013 |
Junior Member |
|
|
Hey, Tiburon-
We've encountered the exact same problem; unfortunately the shim solution does not work.
What is working for me right now is to hide and show the applet using the style property visibility. To detect when to hide/show, in my Composite (that contains the Browser with the webpage with the applet), I listen for SWT.Show, SWT.Hide, SWT.Close, and SWT.Dispose by invoking:
PlatformUI.getWorkbench().getDisplay().addFilter(...)
In my handleEvent(...) method, I only look at instances of Shell, and I keep track of all of the Shells that have popped up (so hide the applet for the first, then show it after the last one has been been cleared (SWT.Hide, SWT.Close, and SWT.Dispose).
So far so good, it's been working great.
Hope that helps!
All best,
-Zach
|
|
| | | | | | | |
Goto Forum:
Current Time: Sat Apr 20 03:24:26 GMT 2024
Powered by FUDForum. Page generated in 0.03699 seconds
|