Hi shaselai,
It seems to me that what you're most interested in is actually the absolute
position of the left and right widgets contained in the HorizontalSplitPanel
rather than the panel's split position. I believe this makes sense since you
want to retrieve and restore layout positions for widgets contained in the
left and right panels contained in the split panel, rather than directly in
the split panel itself.

If that's the case, perhaps these calls are more what you're looking for
rather than the getAbsoluteTop() and getOffsetWidth() calls you're making on
the split panel, which will only return the positions for the split panel,
and not the subpanels it contains:

hsp.getLeftChild().getOffsetWidth();
hsp.getRightChild().getOffsetWidth();

Also, the reason why you may be getting the value of 0 for getAbsoluteTop()
and getOffsetWidth() on the horizontal split panel could be because of the
time at which you're making those calls. That is, if you're making those
calls as your application is loading, it's possible that the calls are being
made before the split panel is completely rendered on the page, which means
you'll read uninitialized values instead of the actual position of the split
panel.

Try delaying the call to those methods a few seconds, you should be able to
read in the right value for the split panel position.

Hope that helps,
-Sumit Chandel

On Thu, Oct 16, 2008 at 12:41 PM, shaselai <[EMAIL PROTECTED]> wrote:

>
> I have a setup where I have a vertical panel that holds a horizontal
> split panel. The horizontal split panel holds on its left a vertical
> split panel containing two vertical panels and on its right a vertical
> panel. I basically drag items to the right panel and restores them
> through UI(open/load). The problem is the splitpanels are draggable
> and when i save the location of the objects they are saved as the
> location prior to any changes in the dragging of the splitpanels. So
> if I dont drag the splitpanel the leftmost position inside the right
> panel might be 150. However, if i drag the splitpane right and loads
> up the items, the location (150,y) is no longer where it was supposed
> to be. So I have to save the size relative to the scrollpanel's
> location (ex. 20 to the right of the splitpanel). The problem arises
> when I try to find the current location of the splitpanel. i tried the
> getOffsetWidth, getAbsoluteLeft() of the panels and they all return 0.
> Is there a way to find out the current location of the splitpanel's
> "slider"(the  thing you move left/right) so the items can be loaded
> relative to that?
>
> thanks!
> >
>

--~--~---------~--~----~------------~-------~--~----~
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