<script type="text/javascript"> <!-- …… //附件上传后回调方法 function testCallBack(fileid){//处理文件逻辑的action location.href="/t1/fileController.do?fileid="+fileid;
} //--> </script> …… <div class="comp" comp="type:'fileupload',callMethod:'testCallBack'">
<input type="button" onclick="insertAttachment()" value="上传附件">
![]()
增加回调方法,回调时会传入文件的id,需要把该id传入到目标action中。 |
|||||||||||||||||||||||||||||||||||||||||||
在此方法中请求处理文件的action,若属性firstSave为ture,则fileid为包含Attachment 的js ArrayList。 Attachment属性如下: this.id = id; this.reference = reference; this.subReference = subReference; this.category = category; this.type = type; this.filename = filename; this.mimeType = mimeType; this.createDate = createDate; this.size = size; this.fileUrl = fileUrl; this.description = description || ""; this.needClone = needClone; this.extension = extension; this.icon = icon; this.isCanTransform = isCanTransform == 'true' ? true : false; this.onlineView = onlineView == null ? true : onlineView; this.extReference = ""; this.extSubReference = ""; this.showArea=""; |
|||||||||||||||||||||||||||||||||||||||||||
声明文件上传标记。注意comp属性值为:"type:'fileupload'" |
|||||||||||||||||||||||||||||||||||||||||||
如果一页只有一个上传组件调用insertAttachment()显示上传界面, 如果有多个上传组件需要调用insertAttachmentPoi(attachmentTrId属性的值)方法,该方法需要和attachmentTrId属性配合使用。 支持属性:
|