阅读:12471回复:1
DAO.save只传beanName和mode,不传type为什么也能保存?
DAO.save只传beanName和mode,不传type为什么也能保存?
[{beanName:'tb_requisition_form',mode:'insert'}].concat(data),这种形式的数据没有传type也能保存。 |
|
最新喜欢:周进 |
沙发#
发布于:2016-09-18 11:26
1:DAO的save方法中先调用init方法
save: function(C, B) { var A = DAO.init(C, B); if (A) { Seam.Component.getInstance("CommonDao").save(A[0], A[1], function(D) { if (B) { B(D) } TOPBAR.cancel() }) } } 2:init方法中先判断type == "data",如果没有设置type,直接以表单方式初始化后台Bean:Seam.Component.newInstance init: function(H, D) { var G = []; var B = []; if (Object.prototype.toString.apply(H) === "[object Array]") { for (var C = 0; C < H.length; C++) { if (H[C].beanName) { var F = new Seam.Remoting.Map(); F.put("mode", H[C].mode); F.put("ignoreFields", H[C].ignoreFields); F.put("includeFields", H[C].includeFields); G[C] = F; if (H[C].type == "data") { B[C] = DAO.initData_Data(Seam.Component.newInstance(H[C].beanName), H[C].data) } else { B[C] = DAO.initData_Form(Seam.Component.newInstance(H[C].beanName)); if (H[C].dataCallBack) { B[C] = H[C].dataCallBack(B[C]) } } } else { //后续代码省略。。。 |
|
|