What does DatePickerPosition.AUTO actually do?

15 views
Skip to first unread message

Hannes

unread,
May 8, 2017, 1:17:25 PM5/8/17
to GwtBootstrap3
Hi,

I derived my own DatePicker class from org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker. (GWTBootstrap 0.9.3)

My DatePicker shows up on the far right side on the screen, on various vertical positions (at the top of the screen, in the middle, and on the far bottom)

I use DatePickerPosition.AUTO.

My problem is that datepickers which are located at the bottom of the screen still open up to the bottom and therefore are only in part visible. I would have expected that AUTO would decide whether to the top or  to the bottom is better. So a datepicker shown on the bottom of the screen would automatically popup to the top?

Any insights on this?

Best regards
Hannes

Message has been deleted

Hannes

unread,
May 8, 2017, 1:59:41 PM5/8/17
to GwtBootstrap3
I tried this hack, but show seems to be the wrong event?

[...]
this.addShowHandler(new ShowHandler() {

@Override
public void onShow(final ShowEvent showEvent) {
if (getAbsoluteTop() > Window.getClientHeight()/2) {
setPosition(DatePickerPosition.BOTTOM_LEFT);
} else {
setPosition(DatePickerPosition.TOP_LEFT);
}
}

});
[...]
Reply all
Reply to author
Forward
0 new messages