读书人

smartgwt下传跳转的有关问题-iframe 嵌

发布时间: 2012-10-24 14:15:58 作者: rapoo

smartgwt上传跳转的问题----iframe 嵌在当前页面 form 标签里面有指定跳到那个frame里面
formDoc.setEncoding(Encoding.MULTIPART);
formDoc.setTarget("fff");
form 里面记得写

formDoc.setTarget("fff");
这个是跳转iframe 的

HTMLPane htmlPane = new HTMLPane();
htmlPane.setContentsType(ContentsType.PAGE);
htmlPane
.setContents("<iframe name='fff' style='position:absolute;width:0;height:0;border:0'></iframe>");
htmlPane.setWidth("1");
htmlPane.setHeight("1");



final DynamicForm uploadForm = new DynamicForm();
uploadForm.setAction("uploadServlet");
uploadForm.setEncoding(Encoding.MULTIPART);
uploadForm.setMethod(FormMethod.POST);
uploadForm.setTarget("foo");

final UploadItem imageItem = new UploadItem("image","图片");

ButtonItem saveItem = new ButtonItem("save","上传");
saveItem.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {

@Override
public void onClick(
com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
uploadForm.submitForm();
}
});

读书人网 >Web前端

热点推荐