| 4286 |
rajveer |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
|
|
3 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
4 |
|
|
|
5 |
import com.google.gwt.core.client.GWT;
|
|
|
6 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
7 |
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
8 |
import com.google.gwt.user.client.ui.Button;
|
|
|
9 |
import com.google.gwt.user.client.ui.DialogBox;
|
|
|
10 |
import com.google.gwt.user.client.ui.FileUpload;
|
|
|
11 |
import com.google.gwt.user.client.ui.FormPanel;
|
|
|
12 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
13 |
|
|
|
14 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
|
|
15 |
|
|
|
16 |
public class FileUploadBox extends DialogBox {
|
|
|
17 |
private FormPanel form;
|
|
|
18 |
|
|
|
19 |
public FileUploadBox(final EventBus eventBus, final long warehouseId){
|
|
|
20 |
VerticalPanel vpanel = new VerticalPanel();
|
|
|
21 |
|
|
|
22 |
form = new FormPanel();
|
|
|
23 |
form.setEncoding(FormPanel.ENCODING_MULTIPART);
|
|
|
24 |
form.setMethod(FormPanel.METHOD_POST);
|
|
|
25 |
form.setAction(GWT.getHostPageBaseURL() + "process-inventory-report");
|
|
|
26 |
vpanel.add(form);
|
|
|
27 |
vpanel.setHeight("80px");
|
|
|
28 |
HorizontalPanel hpanel = new HorizontalPanel();
|
|
|
29 |
|
|
|
30 |
FileUpload upload = new FileUpload();
|
|
|
31 |
upload.setName("file");
|
|
|
32 |
hpanel.add(upload);
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
Button submitbutton = new Button("Upload");
|
|
|
36 |
hpanel.add(submitbutton);
|
|
|
37 |
form.setWidget(hpanel);
|
|
|
38 |
|
|
|
39 |
setWidget(vpanel);
|
|
|
40 |
setAutoHideEnabled(true);
|
|
|
41 |
setGlassEnabled(true);
|
|
|
42 |
setText("Select file to upload");
|
|
|
43 |
setModal(true);
|
|
|
44 |
|
|
|
45 |
submitbutton.addClickHandler(new ClickHandler() {
|
|
|
46 |
public void onClick(ClickEvent event) {
|
|
|
47 |
form.submit();
|
|
|
48 |
}
|
|
|
49 |
});
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
}
|