Vertical location of component

Hi,
Is there any way to find out which is the vertical location of a component?
I have created a view that is generated stacking layouts dynamically. On every layout there is a button. When the user pushes the button, a dialog appears.
I would like to set the vertical location of the dialog (with the setPositionY -method) near the button, but I can’t determine the y location of the button. Now the dialog opens at the top of the view and the user needs to scroll to see it.

HI,

Unfortunately there is no way to find out the vertical position of your button, but have a look at the PopupView -component; it’s designed for this kind of situation.

Best Regards,
Marc

Same problem annoyed me too. I altered Button to send click location to server. I wrote on article about it: http://dev.itmill.com/wiki/Articles/Window/OpenWindowNearButton

Thank you Mauno, that is the functionality I need. Could this be included in Toolkit in the future?
I’m going to check out the PopupView as well, but I haven’t found much information about that. Where should I look for it?

PopupView can be found in 5.3, but not in 5.2 - I’m guessing that’s why you can’t find it…?

I noticed that the class is in the rc jar. I was actually looking for some kind of information or documentation what the PopupView is all about. Sorry for being unclear.

The PopupView is new to 5.3 so I think no documentation has been written for it yet. Basically it is a way to represent some data in a smaller form, for example in a table so it loads faster. The user is then able to open a larger, possibly more complex view to the data as a popup.

Minimal example:


final String minimal = "Small and quick to load HTML";
final Label full = new Label("The big picture. Could also be an editor.");

PopupView pv = new PopupView(new PopupView.Content() {
            public String getMinimizedValueAsHTML() {
                return minimal;
            }

            public Component getPopupComponent() {
                return full;
            }
});