Open a dialog to choose a file

Hello all !

My application has a button where i want open a dialog and choose a file.
How can i do this ?

Sorry about my english. Thanks !



btnArquivo.addListener(new ClickListener() {
			public void buttonClick(ClickEvent event) {

				// What i do here

			}
		});

If the file is to be selected from the user’s computer, you need to use something like UploadFile which can be used to select a local file to be uploaded. You cannot control the selection of files on the user’s computer outside of the browser’s file chooser.

If the file exists on your server, then you need to create a Table/NativeSelect/VerticalLayout (list of some sort) that shows whatever files you have.