Boris19
(Boris Mitioglov)
February 18, 2013, 4:17pm
1
Hi, i’m trying to listen BrowserWindowResizeEvent event. It shows notification only when i clicked on something in my window, but when i resize and don’t click, nothing get happen. What I did wrong?
[code]
final Page page = this.getPage();
this.getPage().addBrowserWindowResizeListener(new BrowserWindowResizeListener() {
public void browserWindowResized(BrowserWindowResizeEvent event) {
Notification.show("Window width="+event.getWidth()+", height="+event.getHeight());
stateLabel.setValue("Change! height="+event.getHeight());
split.setMinSplitPosition(page.getBrowserWindowHeight()-33, Unit.PIXELS);
split.setLocked(true);
//hlay.setWidth(100, Unit.PERCENTAGE);
}
});
[/code]
Henri2
(Henri Sara)
February 19, 2013, 7:39am
2
I guess you already got a reply in another thread (
http://dev.vaadin.com/ticket/10055
).
Boris19
(Boris Mitioglov)
February 19, 2013, 9:05am
3
Please can you explain me in code. I download refresher add-on and put it in WEB-INF/lib, what i should do next?
Henri2
(Henri Sara)
February 19, 2013, 10:27am
4
See the code sample highlight on the
Directory page of the add-on
. You probably don’t need everything from there, just the addExtension(new Refresher()) in your UI init() method.
Note also that the Refresher has client side parts, so you need a custom widgetset in your project if you don’t already have one and need to compile it. See
this help page
or the
Book of Vaadin
if you don’t know how to do it.
Boris19
(Boris Mitioglov)
February 19, 2013, 11:34am
5
See the code sample highlight on the
Directory page of the add-on
. You probably don’t need everything from there, just the addExtension(new Refresher()) in your UI init() method.
Note also that the Refresher has client side parts, so you need a custom widgetset in your project if you don’t already have one and need to compile it. See
this help page
or the
Book of Vaadin
if you don’t know how to do it.
Thanks.
It works fine
class MyBrowserResizeListener implements RefreshListener {
private static final long serialVersionUID = -8765221895426102605L;
@Override
public void refresh(final Refresher source) {
page.addBrowserWindowResizeListener(new BrowserWindowResizeListener() {
public void browserWindowResized(BrowserWindowResizeEvent event) {
stateLabel.setValue("Change! height="+event.getHeight());
split.setMinSplitPosition(page.getBrowserWindowHeight()-33, Unit.PIXELS);
split.setLocked(true);
}
});
}
}
Refresher refr = new Refresher();
refr.addListener(new MyBrowserResizeListener());
addExtension(refr);