开发者

DialogBox depth (z-index) in GWT

Having many GWT DialogBox'es, the first one always stays at the bottom and new ones are created on top. What I am trying to obtain is a way to bring one of such dialogs on top when it is clicked. I haven't found the GWT approach to handle dept开发者_StackOverflow社区h (something related to a CSS label z-index but it lacks some documentation).


I think, you can use something like this:

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


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 the @external references if you are not using CssResource).

That way all your popups, dialogboxes and popup glasses will be over other items in the page. Make sure no other item has z-index above the value you choose (in my example, 1000).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜