package com.client;
import com.shared.FieldVerifier;
public class FileUploadsmart implements EntryPoint {
//FormPanel formPanel ;
//TextField textField1;
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
VLayout layout;
public void onModuleLoad() {
RootPanel p=RootPanel.get();
VLayout layout = new VLayout();
layout.setSize("100px", "44px");
final DynamicForm uploadForm = new DynamicForm();
uploadForm.setSize("54px", "147px");
uploadForm.setEncoding(Encoding.MULTIPART);
// UploadItem fileItem = new UploadItem("image");
HTML q =new HTML();
q.setHTML("<"+"div style='display: block; width: 100px; height: 20px; overflow: hidden;'"+">"
+ "<"+"button style='width: 110px; height: 30px; position: relative; top: -5px; left: -5px;'"+">"+ "<a href= 'javascript: void(0)'>upload file</a>"+"</button>"
+"<"+"input type='file' id='upload_input' name='upload' style='font-size: 50px; width: 120px; opacity: 0; filter:alpha(opacity: 0); position: relative; top: -40px; left: -20px'"+"/>" +
"</div>" );
uploadForm.setAction(GWT.getModuleBaseURL()+"upload");
IButton uploadButton = new IButton("Attachment");
uploadButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
@Override
public void onClick(
com.smartgwt.client.widgets.events.ClickEvent event) {
// TODO Auto-generated method stub
uploadForm.submitForm();
}
});
uploadForm.addChild(q);
///uploadForm.setItems(fileItem);
layout.setMembers(uploadForm, uploadButton);
RootPanel.get().add(layout, 2, 2);
}
}
import com.shared.FieldVerifier;
public class FileUploadsmart implements EntryPoint {
//FormPanel formPanel ;
//TextField textField1;
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
VLayout layout;
public void onModuleLoad() {
RootPanel p=RootPanel.get();
VLayout layout = new VLayout();
layout.setSize("100px", "44px");
final DynamicForm uploadForm = new DynamicForm();
uploadForm.setSize("54px", "147px");
uploadForm.setEncoding(Encoding.MULTIPART);
// UploadItem fileItem = new UploadItem("image");
HTML q =new HTML();
q.setHTML("<"+"div style='display: block; width: 100px; height: 20px; overflow: hidden;'"+">"
+ "<"+"button style='width: 110px; height: 30px; position: relative; top: -5px; left: -5px;'"+">"+ "<a href= 'javascript: void(0)'>upload file</a>"+"</button>"
+"<"+"input type='file' id='upload_input' name='upload' style='font-size: 50px; width: 120px; opacity: 0; filter:alpha(opacity: 0); position: relative; top: -40px; left: -20px'"+"/>" +
"</div>" );
uploadForm.setAction(GWT.getModuleBaseURL()+"upload");
IButton uploadButton = new IButton("Attachment");
uploadButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler()
{
@Override
public void onClick(
com.smartgwt.client.widgets.events.ClickEvent event) {
// TODO Auto-generated method stub
uploadForm.submitForm();
}
});
uploadForm.addChild(q);
///uploadForm.setItems(fileItem);
layout.setMembers(uploadForm, uploadButton);
RootPanel.get().add(layout, 2, 2);
}
}
No comments:
Post a Comment