PDA

View Full Version : Download link to a file with Button



aliasadsahu
3 May 2012, 11:00 AM
Hi I want to make a button which will start downloading a file when user clicks on it. How it is possible?

harun
8 May 2012, 6:49 AM
it is so easy:



Button button = new Button( "Download" );
button.addSelectionListener( new SelectionListener<ButtonEvent>() {

@Override
public void componentSelected( ButtonEvent ce)
{
Window.open( url, "_blank", null );
}
} );