起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13619|回复: 3

[结贴] 弹出页面附件上传fileid为空问题

[复制链接]

20

主题

57

帖子

185

积分

初级会员

Rank: 2

积分
185
QQ
发表于 2016-2-23 14:44:03 | 显示全部楼层 |阅读模式
版本: BeX5V3.1 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
需求是使用“单表-列表+详细(对话框)”的模式,在弹出页面实现文件上载,使用控件是attachmentPC。
遇到问题是附件的字段中json里的fileid为空。
参考解决方案是
http://bbs.wex5.com/forum.php?mo ... =fileID%2B%E7%A9%BA
还有
http://bbs.wex5.com/forum.php?mo ... =fileID%2B%E7%A9%BA

但是,在弹出界面保存数据应该如何写?
我目前的写法是:

        Model.prototype.okBtnClick = function(event) {
                var mainData = this.comp("dialogData");               
                mainData.saveData();
                this.comp("windowReceiver").windowEnsure(mainData.getCurrentRow());
                this.getParent().comp("mainData").refreshData();
        };

执行到mainData.saveData();时,报错信息如下:
2016-02-23 14:43:01 KSQL 执行时间:4ms, ksql: UPDATE TM_Guides TM_Guides SET TM_Guides = :TM_Guides_new, TM_Guides.fBaseCountry = :fBaseCountry_new, TM_Guides.fGImages = :fGImages_new, TM_Guides.fName = :fName_new, TM_Guides.fSex = :fSex_new, TM_Guides.version = :version + 1  WHERE TM_Guides= :TM_Guides_old AND TM_Guides.version = :version_old
2016-02-23 14:43:01 excute stream action, params:{"actions":[{"accept":"application/json","action":"saveTM_GuidesAction","actionFlag":"__action_0__","activity":"mainActivity","contentType":"json","executeContext":"","executor":"","parameters":{"table":{"@type":"table","rows":[{"fBaseCountry":{"changed":1,"value":"伦敦"},"fDOB":{"changed":0},"fEmail":{"changed":0},"fGImages":{"changed":1,"value":"[]"},"fGRemark":{"changed":0},"fIDNo":{"changed":0},"fName":{"changed":1,"value":"导游一"},"fNativePlace":{"changed":0},"fPhone":{"changed":0},"fQQ":{"changed":0},"fSex":{"changed":1,"value":"男"},"userdata":{"id":{"changed":1,"value":"4121F179316C47DCBC0D7AE116C8B5AB"},"isModified":true,"recordState":"edit"},"version":{"changed":0,"value":10}}],"userdata":{"idColumnDefine":"TM_Guides","idColumnName":"TM_Guides","idColumnType":"String","model":"/TMS/commgt/data","relationAlias":"fBaseCountry,fDOB,fEmail,fGImages,fGRemark,fIDNo,fName,fNativePlace,fPhone,fQQ,fSex,version","relationTypes":"String,Date,String,String,String,String,String,String,String,String,String,Integer","relations":"TM_Guides.fBaseCountry,TM_Guides.fDOB,TM_Guides.fEmail,TM_Guides.fGImages,TM_Guides.fGRemark,TM_Guides.fIDNo,TM_Guides.fName,TM_Guides.fNativePlace,TM_Guides.fPhone,TM_Guides.fQQ,TM_Guides.fSex,TM_Guides.version","updateMode":"whereVersion"}}},"process":"/TMS/commgt/process/guides/guidesProcess"},{"accept":"application/json","action":"saveAttachAction","actionFlag":"__action_1__","activity":"mainActivity","contentType":"json","executeContext":"","executor":"","parameters":{"changeLog":"{\"items\":[],\"createVersionLogs\":[],\"operate\":\"saveDoc\",\"url\":\"\",\"process\":\"/TMS/commgt/process/guides/guidesProcess\",\"activity\":\"mainActivity\",\"isHttps\":false}","isSaveDocLink":false},"process":"/SA/doc/system/systemProcess"}]}
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.justep.system.action.Engine.invokeActions(Native Method)
        at com.justep.system.action.Engine.invokeActions(Unknown Source)
        at com.justep.business.server.BusinessServer.doAction(Unknown Source)
        at com.justep.business.server.BusinessServer.doExcute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServer.excute(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.execService(Unknown Source)
        at com.justep.business.server.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at com.justep.x.bs.BusinessServerServlet.service(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150186; 提示: 更新记录TM_Guides, TM_Guides, key="4121F179316C47DCBC0D7AE116C8B5AB"出错, 不存在符合条件的数据, UPDATE TM_Guides TM_Guides SET TM_Guides = :TM_Guides_new, TM_Guides.fBaseCountry = :fBaseCountry_new, TM_Guides.fGImages = :fGImages_new, TM_Guides.fName = :fName_new, TM_Guides.fSex = :fSex_new, TM_Guides.version = :version + 1  WHERE TM_Guides= :TM_Guides_old AND TM_Guides.version = :version_old; 可能的原因: 数据被其他用户修改了; 数据被其他用户删除了
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableImpl.edit(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.impl.TableImpl.save(Unknown Source)
        at com.justep.system.data.BizData.save(Unknown Source)
        at BizProcedure.save(BizProcedure.java:143)

        ... 27 more


请问是不是我的写法不对?应该如何在弹出页面进行数据保存呢?


20

主题

57

帖子

185

积分

初级会员

Rank: 2

积分
185
QQ
 楼主| 发表于 2016-2-23 14:53:54 | 显示全部楼层
参考
http://bbs.wex5.com/forum.php?mo ... hlight=JUSTEP150186
4楼的部分,问题得到解决

所以,可以结贴
回复 支持 反对

使用道具 举报

62

主题

152

帖子

648

积分

高级会员

Rank: 4

积分
648
QQ
发表于 2018-6-7 20:20:55 | 显示全部楼层
朋友,有demo吗?我也纠结了快一天了,fileid还是为空
回复 支持 反对

使用道具 举报

1014

主题

4371

帖子

1万

积分

论坛元老

Rank: 8Rank: 8

积分
10979
QQ
发表于 2021-6-25 20:32:24 | 显示全部楼层
本帖最后由 ecoolper 于 2021-6-25 20:35 编辑

【在弹出窗中上传附件,必须在弹出窗中保存的原因】
1、上传附件未保存,附件保存在文档中心缓存目录下;
2、只有附件对应的数据集保存时,附件才保存到文档中心对应目录下;
3、在数据集保存时,附件的FileId才给赋值,只上传未保存不会给FileId赋值;
【解决方案】
方案一:在弹出窗中保存数据;
方案二:使用cdata数据集,弹出窗返回前cdata数据集调用save动作;

----------------------
在数据集保存时,附件组件会自动调用两个Action:commitAttachAction、saveAttachAction
孤舟蓑笠翁,独钓寒江雪。
X5牛刀交流民间第一群:30057529
提供有偿服务,联系WX:18332024
bex5疑难问题解决方案
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-24 03:57 , Processed in 0.100495 second(s), 25 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表