Hi,
I'm trying to create a popup panel using a VLayout to overlay on top current content.
The panel is supposed to be "shrink wrap" base on the referenced topic.
https://forums.smartclient.com/forum...-use-scrolling
There are two issues I'm facing:
Code:
SmartGWT version - 4.0p
I'm trying to create a popup panel using a VLayout to overlay on top current content.
The panel is supposed to be "shrink wrap" base on the referenced topic.
https://forums.smartclient.com/forum...-use-scrolling
There are two issues I'm facing:
- The MouseOutEvent is fired within the assigned VLayout(allergyPopUp), which caused the popup panel closed before moving the cursor out of the VLayout(allergyPopUp).
e.g. when I mouseover to the 2nd child of allergyPopUp, the mouseOut event is fired. - After the ResizedEvent is fired, the parent div's height is shrinked to defined height(380px), but the child content is overflowed and scrollbar is not initialized.
- alertAllergy and allergyPopUp is on peer level.
- alertAllergy is the trigger for popup panel, where allergyPopUp is the popup.
- allergyPopUp is populated with three HLayout members.
Code:
Code:
alertAllergy.addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { if ((VLayout)((AlertAllergyPanel) event.getSource()).getPopUpFlow() != null && !allergyPopUp.isVisible()) { allergyPopUp.removeMembers(allergyPopUp.getMembers()); allergyPopUp.addStyleName("allergy-popup"); allergyPopUp.setVisibility(Visibility.HIDDEN); allergyPopUp.setPosition(Positioning.ABSOLUTE); allergyPopUp.setLeft(95); allergyPopUp.setTop(((AlertAllergyPanel) event.getSource()).getTop() + 1); allergyPopUp.setWidth((int)(((AlertAllergyPanel) event.getSource()).getWidth() * 0.99 - 1) - 90); allergyPopUp.setOverflow(Overflow.VISIBLE); allergyPopUp.addMembers(((VLayout)((AlertAllergyPanel) event.getSource()).getPopUpFlow()).getMembers()); allergyPopUp.bringToFront(); allergyPopUp.show(); } } }); allergyPopUp.addMouseOutHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { if (((VLayout) event.getSource()).isVisible()) { ((VLayout) event.getSource()).hide(); } } }); allergyPopUp.addResizedHandler(new ResizedHandler() { @Override public void onResized(ResizedEvent event) { if (((VLayout) event.getSource()).getOffsetHeight() > 400) { ((VLayout) event.getSource()).setOverflow(Overflow.AUTO); ((VLayout) event.getSource()).setHeight(380); } else { ((VLayout) event.getSource()).setOverflow(Overflow.VISIBLE); } } });
Comment