Depth DialogBox (z-index) in GWT

Having many GWT DialogBoxes, the first one always remains below, and the new ones from above. What I'm trying to get is a way to bring one of these dialogs from above when it is clicked. I did not find the GWT approach for handling depth (something has to do with the z-index CSS label, but it lacks documentation).

+7
source share
2 answers

I think you can use something like this:

 DialogBox d=new DialogBox(); d.getElement().getStyle().setZIndex(intValue); 
+9
source

You can also define a CSS rule for all DialogBoxes in the system:

 @external gwt-PopupPanel; @external gwt-DialogBox; @external gwt-PopupPanelGlass; .gwt-PopupPanel, .gwt-DialogBox, .gwt-PopupPanelGlass { z-index: 1000; } 

(Remove @ external links if you are not using CssResource ).

This way all your pop-ups, dialogs and pop-ups will be on top of other elements on the page. Make sure that the other element does not have a z index higher than the value you selected (in my example 1000).

+1
source

All Articles