it works fine for me , i need to open the BrowserWindowOpener based on some condision(ie i need to do two things check the file first and open BrowserWindowOpener ) when button is clecked so how can i do this code inside buttopn click listener.
Hi,
if you extend a Button with BrowserWindowOpener then a click handler will be added on the client side
so new window will be opened before your server side click listener is invoked.
If your need is to have a dynamic content generated on button click you can either implement a custom StreamSource and give it to a StreamResource or even extend StreamResource and override getStream or getStreamSource;
then you can initialize your BrowserWindowOpener with this StreamResource.
There are a lot of post regarding this argument on the forum.
Instead if you want to have your listener code inovked before window open take a look at this
post ;
in this solution the click listener on client side does nothing and the window is opened at the end of the request generated by clicking the button, but this requires a widgetset recompilation.