multiple dialog box/popup panel overlap issue

754 views
Skip to first unread message

rakesh wagh

unread,
Jul 7, 2009, 10:39:58 PM7/7/09
to Google Web Toolkit
I have multiple dialog boxes(or popup panels) on my screen. When I
drag one, it should show up on top of others. But that does not
happen. All dialog boxes mantain the other in which they were added.
Unfortunately show()/hide() is not the option for me. All my non modal
dialog box windows are always in the show() state.

Any solution??

I tried playing around z-index a bit, but no luck so far.

Thanks...

Rakesh

unread,
Jul 7, 2009, 10:47:58 PM7/7/09
to Google Web Toolkit
typo:
...All dialog boxes mantain the other ...
=
...All dialog boxes mantain the "order" ...

Ian Bambury

unread,
Jul 7, 2009, 10:53:13 PM7/7/09
to Google-We...@googlegroups.com
Have you actually *tried* a hide followed by a show to see the effect?

Rakesh

unread,
Jul 8, 2009, 3:16:20 PM7/8/09
to Google Web Toolkit
as I said,
hide/show is not an option. Consider that the DialogBoxes are always
in show state. User can drag them over each other.

Does any one know how PopupPanel manages z-index and lisbox on top
issue? I looked in the PopupPanel class several times, without any
luck :(

Rakesh Wagh

On Jul 7, 9:53 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> Have you actually *tried* a hide followed by a show to see the effect?
> Ian
>
> http://examples.roughian.com
>
> 2009/7/8 Rakesh <rake...@gmail.com>

Ian Bambury

unread,
Jul 8, 2009, 6:29:39 PM7/8/09
to Google-We...@googlegroups.com
Hide/Sow will work. So will zIndex. Try this:

public class Main implements EntryPoint, MouseDownHandler
{
    DialogBox a = new DialogBox(false, false);
    DialogBox b = new DialogBox(false, false);

    public void onModuleLoad()
    {
        a.setText("AAAAAAAAAAA");
        a.setWidget(new Label("aaaaaaaaa"));
        a.getElement().getStyle().setProperty("backgroundColor", "cyan");
        a.getCaption().addMouseDownHandler(this);
        a.center();

        b.setText("BBBBBBBBBBBBB");
        b.setWidget(new Label("bbbbbbbbbb"));
        b.getElement().getStyle().setProperty("backgroundColor", "yellow");
        b.getCaption().addMouseDownHandler(this);
        b.center();
    }

    @Override
    public void onMouseDown(MouseDownEvent event)
    {
        Widget d = (Widget) event.getSource();
        DialogBox c = (DialogBox) d.getParent();
        a.getElement().getStyle().setProperty("zIndex", "0");
        b.getElement().getStyle().setProperty("zIndex", "0");
        c.getElement().getStyle().setProperty("zIndex", "1");
    }
}


Rakesh

unread,
Jul 8, 2009, 10:48:13 PM7/8/09
to Google Web Toolkit
Ian, you are right about the zindex.
However the problem is that I need to have access to all the windows/
popups(floating divs) that are on my screen; and need to control
zindexes of all. This might not always be possible. For example I am
writing an reusable widget that has multiple popups which will always
stay on the screen once my widget is instantiated. This widget will be
used in different applications in my company. I have little or no
access to what other popups/widgets/absolute divs will be open on the
screen. However I need to make sure that any of the dialogboxes shown
in my re usable widget are always on the top once they are dragged...

thanks any way...

Do you by any chance happen to know how gwt manages the "popup on top
of listbox" issue in its code?

Rakesh Wagh
> 2009/7/8 Rakesh <rake...@gmail.com>
Reply all
Reply to author
Forward
0 new messages