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();
}
});

你可能感兴趣的:(smartgwt)