There's nothing like answering your own post!
I went ahead and implemented the "shim" solution referenced below. It
works great in IE6 and 7. In Firefox, only the area covered by the
iframe is on top of the applet, meaning that if you move the dialog,
it goes behind the applet as soon as it is over the same area of the
screen.
I see three possible workarounds for the Firefox issue: 1) make the
iframe move along with the dialog 2) put the iframe on top of the
applet only (it would look weird as the applet GUI would disappear
while the dialog is being shown), and 3) somehow disable dragging/
moving on the dialog. Probably the first one would be the cleanest
solution, although it could be more involved. Anyway, for now it is
good enough for me since the great majority of our users are on IE.
This is how you do it:
// on an onClick() method that will display the dialog:
myDialog.center();
int left = myDialog.getPopupLeft();
int top = myDialog.getPopupTop();
int width = myDialog.getOffsetWidth();
int height = myDialog.getOffsetHeight();
// create the iframe element
iframe = DOM.createElement("iframe");
iframe.setClassName("shimmer");
frameStyle.setPropertyPx("left", left);
frameStyle.setPropertyPx("top", top);
frameStyle.setPropertyPx("width", width);
frameStyle.setPropertyPx("height", height);
IFrameElement iframeElem = IFrameElement.as(iframe);
iframeElem.setFrameBorder(0);
DOM.appendChild(RootPanel.getBodyElement(), iframe);
myDialog.show();
// on the onClick() method of the "close" dialog button:
DOM.removeChild(RootPanel.getBodyElement(), iframe);
myDialog.hide();
It also uses these CSS properties:
.shimmer {
position: absolute;
z-index: 999;
}
.gwt-DialogBox {
z-index: 1000;
}
On Oct 27, 5:51 pm, El Mentecato Mayor <[EMAIL PROTECTED]>
wrote:
> Has GWT solved to the known problem of displaying html elements on top
> of Java applets? GWT already solves the similar problem around
> ListBoxes, so I would guess a similar solution applies to Java
> applets.
>
> What I'm seeing is that popups (SuggestBox) and dialogs appear behind
> Java applets (I need to have one on my application), and I don't see a
> way of avoiding this.
>
> There's a workaround (non-GWT) explained
> here:http://www.oratransplant.nl/2007/10/26/using-iframe-shim-to-partly-co...
>
> but I'm wondering if there's something already in gwt to trigger
> something like that or if anybody has created JSNI code already to
> achieve the same functionality.
>
> Thanks in advance for any pointers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---