Thomas Lefort
unread,Nov 13, 2012, 8:05:04 AM11/13/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-we...@googlegroups.com
I have a use case where I do need to show one dialog on top of the other. The problem is that those dialogs are reused across the application and if the one that should be on top for the use case happens to have been open (in another use case) before the one that should be below, it is not visible (covered by the other one) because (I believe) it was inserted in the DOM before.
Is there an obvious way of doing this? Currently, the two strategies I can think of to make sure the show method could always ensure that a dialog is on top of the others are the following:
- zindex, scanning the list of open popups and check for the higfhest zindex and setting the zindex of the one I am showing to zindex + 1
- detach/reattach the popup to the DOM.
I gave a quick try to the later one using the following code, which seems to work:
@Override
public void show() {
Widget parent = getParent();
if(parent instanceof Panel) {
((Panel) parent).remove(this);
((Panel) parent).add(this);
}
// blabla do the rest
}
Any idea if this detach/reattach strategy can have any side effect?