Thanks Thomas for the reply.

Your approach works on Mozilla and IE7, but behaves weird on IE6. In
my application, I override the PopupPanel.show() method, as follows :

            public void show(){
                setVisible(false);
                super.show();
                //following logic copied from Popup.center() to show popups in
center of page
                int left = (Window.getClientWidth() - getOffsetWidth()) / 2;
                int top = (Window.getClientHeight() - getOffsetHeight()) / 2;
                setPopupPosition(Window.getScrollLeft() + left,
Window.getScrollTop() + top);
                setVisible(true);
            }

As can be seen, it is required that the popup shows roughly at the
centre of viewport. Works perfect in IE7 and Mozilla, but not in IE6.

Any light in this regard ..?

Ajay Garg
On Sep 18, 1:32 pm, Thomas Broyer <[EMAIL PROTECTED]> wrote:
> On 18 sep, 06:54, Ajay Garg <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi all.
>
> > I have been going through PopupPanel docs, and there does exist ways
> > to set the popup-position, eg. through the PopupPanel.PositionCallback
> > and setPopupPosition() methods. But it seems that the position
> > parameters, correspond to the "entire" browser window. That is, let's
> > say I set the "left" and "right" parameters in setPopupPosition(int
> > left, int right) as 0,0. Thus, the popup will be displayed on top
> > left.
>
> > Now, consider that my page contains records. With time, the number of
> > records increase, and scrollbars then come into play. Now, what is
> > needed that upon pressing the "Delete" button attached to a particular
> > record row, the popup should appear. As there are scrollbars, if the
> > record happens to be the last one (or thereabout), the popup still
> > appears top left of the "complete browser page area", wheras ideally
> > it should appear on the top left of the "effective browser page area"
> > that is visible to me. (I may repeat that since there are scrollbars,
> > the complete browser page area IS NOT EQUAL TO effective page area,
> > when I am looking at one of the last records).
>
> > Any ideas/hacks/workarounds, to get this going ..??
>
>  - use Window.getScrollTop() and Window.getScrollLeft() (avec a look
> at the center() method's code)
>  - or if you don't care about IE6, use position:fixed in your CSS
>
> Note that the end result won't be the same: with position:fixed, your
> popup stays fixed to the 0,0 of the viewport while you're scrolling,
> whereas with the first solution, the popup is initially positionned at
> 0,0 of the viewport area but then scrolls with the rest of the page
> (unless you add a WindowScrollListener to re-position the popup on
> page scroll)- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to