Is Gwt PopupPanel method setPopupPosition overwritten when adding it to another Panel?

StackOverflow https://stackoverflow.com/questions/22964428

  •  30-06-2023
  •  | 
  •  

문제

I'd like to set the position of my PopupPanel relative to the Panel I'm adding it to. However, the position I set with

popupPanel.setPopupPosition(750,230);

is ignored.

Is the method position overwritten when adding it to a panel?

도움이 되었습니까?

해결책

You don't “add a PopupPanel to a panel”. If you do that, then you're treating it like it's a SimplePanel, and it behaves almost like a SimplePanel; so yes setPopupPosition won't work, at least without some additional CSS applied.

If you want to show a PopupPanel relative to another element, use setPopupPositionAndShow and compute the position relative to the other element's absolute position.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top