ocrio.box
(Ivan Ovchinnikov)
March 6, 2018, 1:30pm
#1
Hello, i’m working on a simple project which should inform user of something as user logs in. so i decided to use a PopupView, but can’t set it’s location on a screen. can you please help me with that?
tsarev
(Daniil Tsaryov)
March 7, 2018, 5:25am
#3
Hello, @ocrio.box
Unfortunately there is no ability to set popup position now.
The align
property affects the minimizedValue
label.
Also, i’ve created a ticket in YouTrack: link .
Regards,
Daniil.
2 Likes
Hi @tsarev ,
The issue link is not accessible now, could you suggest if we are able to set PopupView position programmatically now?
tsarev
(Daniil Tsaryov)
November 11, 2019, 12:47pm
#6
Hello @hanbing.yin
You can find the issue on GitHub:
opened 05:22AM - 07 Mar 18 UTC
closed 02:49PM - 22 Nov 19 UTC
type: enhancement
state: fixed
ver: 7.2.0
A topic on the support forum: https://www.cuba-platform.com/discuss/t/define-a-p… lace-on-a-frame-where-popupview-will-be-shown/4030
---
Original issue: https://youtrack.haulmont.com/issue/PL-10506
## Updates
The `PopupView` has new methods to set popup position:
* `void setPopupPosition(int top, int left)` - sets the popup position;
* `void setPopupPositionTop(int top)` - sets the top popup position;
* `void setPopupPositionLeft(int left)` - sets the left popup position
* `void setPopupPosition(PopupPosition position)` - sets the popup position using standard values.
And the component has new methods to get popup position:
* `int getPopupPositionTop()` - returns the top popup position;
* `int getPopupPositionLeft()` - returns the left popup position;
* `PopupPosition getPopupPosition()` - returns the top popup position or null if position is set via `setPopupPosition(PopupPosition position)`.
The standard values for popup position:
* DEFAULT, (In the middle of the minimized value)
* TOP_LEFT,
* TOP_CENTER,
* TOP_RIGHT,
* MIDDLE_LEFT,
* MIDDLE_CENTER,
* MIDDLE_RIGHT,
* BOTTOM_LEFT,
* BOTTOM_CENTER,
* BOTTOM_RIGHT;
If the popup position is set using the standard values, the left and top values will be reset and vice versa. Also, the popup will be displayed with a slight indentation. User can disable this indent by overriding `$popup-horizontal-margin` and `$popup-vertical-margin` variables in styles.
### Test project
[popupview-popup-position.zip](https://github.com/cuba-platform/cuba/files/3508457/popupview-popup-position.zip)
## QA
Check the popup position setting using standard values and by entering custom values.
Regards
Thanks, seems have to wait for 7.2.0…