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

QQ登录

只需一步,快速开始

查看: 1275|回复: 4

[结贴] 页面保存时向另一表添加数据时出错

[复制链接]

3

主题

14

帖子

51

积分

初级会员

Rank: 2

积分
51
QQ
发表于 2014-9-23 10:01:27 | 显示全部楼层 |阅读模式
版本: X5.2.7 小版本号:
数据库: MS SQLServer 服务器操作系统: Windows 应用服务器: Tomcat
客户端操作系统: Windows 7 浏览器: IE10
mainActivity.dataMasterAfterSave = function(event){

var moveid=justep.xbl("dataMaster").getCurrentID() ;
var DataBudget= justep.xbl("bizDataBudget");

//DataBudget.loadDataByMaster();
var cnt=DataBudget.getCount() ;


if(cnt>0)
{}
else
{
  var options = {
         defaultValues : [
             {SumMoney:"888",GlobeID:moveid}
         ]};  

  DataBudget.newData(options);//这里会报错!
  
  DataBudget.saveData();
}

};

点保存时显示 JUSTEP231020, data保存失败!!,无法获取未定义或 null 引用的属性“controlId”


页面源码是


<?xml version="1.0" encoding="utf-8"?>
<window xmlns="http://www.justep.com/xui" xmlns:data="http://www.justep.com/x5/xui/data#" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:justep="http://www.justep.com/x5#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xforms="http://www.justep.com/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xui="http://www.justep.com/xui" component="/UI/system/components/window.xbl.xml#window" id="window">  
  <xforms:model id="mdDefault" style="top:361px;left:404px;height:130px;">
    <data auto-load="false" auto-new="true" component="/UI/system/components/data.xbl.xml#bizData" concept="CRM_Movement" data-type="json" id="dataMaster" limit="20" offset="0" store-type="simple" update-mode="whereVersion">
      <reader action="/CRM/Custom/logic/action/queryCRM_MovementAction" id="default8"/>  
      <writer action="/CRM/Custom/logic/action/saveCRM_MovementAction" id="default9"/>  
      <creator action="/CRM/Custom/logic/action/createCRM_MovementAction" id="default10"/>
    </data>  
    <data auto-load="true" component="/UI/system/components/data.xbl.xml#bizData" concept="CRM_CostBudgetSub" data-type="json" id="dataDetail" limit="20" offset="0" update-mode="whereVersion">
      <master data="dataMaster" id="master1" relation="GlobeID"/>  
      <creator action="/CRM/Common/logic/action/createCRM_CostBudgetSubAction" id="default2"/>  
      <reader action="/CRM/Common/logic/action/queryCRM_CostBudgetSubAction" id="default3"/>  
      <writer action="/CRM/Common/logic/action/saveCRM_CostBudgetSubAction" id="default4"/>
    </data>
  <data component="/UI/system/components/data.xbl.xml#bizData" update-mode="whereVersion" data-type="json" auto-load="true" id="bizDataBudget" concept="CRM_CostBudget"><creator id="default13" action="/CRM/Common/logic/action/createCRM_CostBudgetAction"></creator>
  <reader id="default14" action="/CRM/Common/logic/action/queryCRM_CostBudgetAction"></reader>
  <writer id="default15" action="/CRM/Common/logic/action/saveCRM_CostBudgetAction"></writer>
  <master id="master2" data="dataMaster" relation="GlobeID"></master></data>
  </xforms:model>  
  <xui:view auto-load="true" id="rootView">
    <xhtml:div component="/UI/system/components/process.xbl.xml#process" data="dataMaster" id="flw"/>  
    <xforms:trigger appearance="image-text" class="button-green" component="/UI/system/components/trigger.xbl.xml#trigger" id="advanceTrigger" operation="advance" operation-owner="flw">
      <xforms:label id="default32"/>
    </xforms:trigger>  
    <xforms:trigger appearance="image-minimal" component="/UI/system/components/trigger.xbl.xml#trigger" id="saveTrigger" operation="save" operation-owner="dataMaster">
      <xforms:label id="default33"/>
    </xforms:trigger>  
    <xhtml:div component="/UI/system/components/menuButton.xbl.xml#menuButton" id="menuButton1" label="更多" mode="left">
      <menuitem id="menuitem1" name="suspend" operation="suspend" operation-owner="flw"/>  
      <menuitem id="menuitem2" name="abort" operation="abort" operation-owner="flw" separator="true"/>  
      <menuitem id="menuitem3" name="customized" operation="customized" operation-owner="flw"/>  
      <menuitem id="menuitem4" name="process-chart" operation="showChart" operation-owner="flw"/>  
      <menuitem id="menuitem5" name="transfer" operation="transfer" operation-owner="flw"/>  
      <menuitem id="menuitem6" name="back" operation="back" operation-owner="flw"/>  
      <menuitem id="menuitem7" name="menuitem7" operation="executeList" operation-owner="flw"/>
    </xhtml:div>  
    <xui:view auto-load="true" class="xui-container" id="vDetail">
      <layout id="layout3" style="position:relative;" type="flow">
        <xhtml:div component="/UI/system/components/excelLayout.xbl.xml#excelLayout" id="excelLayout1" src="mainActivity.xls" style="width:100%;height:100%;"></xhtml:div>
      </layout>  
      <xforms:input class="xui-autofill" id="iptGlobeID" ref="data('dataMaster')/GlobeID" style="display:none;"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptBH" ref="data('dataMaster')/BH"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptTopic" ref="data('dataMaster')/Topic"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptMType" ref="data('dataMaster')/MType"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptGoal" ref="data('dataMaster')/Goal"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptMarkReq" ref="data('dataMaster')/MarkReq"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptStartTime" ref="data('dataMaster')/StartTime"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptEndTime" ref="data('dataMaster')/EndTime"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptOwner" ref="data('dataMaster')/Owner"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptUserIDS" ref="data('dataMaster')/UserIDS"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptAType" ref="data('dataMaster')/AType"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptLev" ref="data('dataMaster')/Lev"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptPreLine" ref="data('dataMaster')/PreLine"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptDescript" ref="data('dataMaster')/Descript"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptSProcess" ref="data('dataMaster')/sProcess" style="display:none;"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptSProcessName" ref="data('dataMaster')/sProcessName" style="display:none;"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptSActivity" ref="data('dataMaster')/sActivity" style="display:none;"></xforms:input>  
      <xforms:input class="xui-autofill" id="iptSActivityName" ref="data('dataMaster')/sActivityName" style="display:none;"></xforms:input>
    </xui:view>  
    <xforms:trigger appearance="image-text" class="button-blue" component="/UI/system/components/trigger.xbl.xml#trigger" id="newTrigger" operation="new" operation-owner="dataDetail">
      <xforms:label id="newTriggerLabel"/>
    </xforms:trigger>  
    <xforms:trigger appearance="image-minimal" component="/UI/system/components/trigger.xbl.xml#trigger" id="deleteTrigger" operation="delete" operation-owner="dataDetail">
      <xforms:label id="saveTriggerLabel"/>
    </xforms:trigger>  
    <xforms:trigger appearance="image-minimal" component="/UI/system/components/trigger.xbl.xml#trigger" id="refreshTrigger" operation="refresh" operation-owner="dataDetail">
      <xforms:label id="refreshTriggerLabel"/>
    </xforms:trigger>  
    <xhtml:div component="/UI/system/components/bizDataFilterMenu.xbl.xml#bizDataFilterMenu" data="dataDetail" id="bizDataFilterMenu2"/>  
    <xhtml:div class="grid-compact" component="/UI/system/components/grid.xbl.xml#grid" data="dataDetail" header-row-height="30" id="grdDetail" row-height="30" show-header-menu="hide-column,save-layout,group-column,adjust-column">
      <column id="default5" label="主题" ref="Topic" type="ed" width="100px"/>  
      <column id="default6" label="费用类型" ref="CostType" type="ed" width="100px"/>  
      <column id="default7" label="单据号" ref="BillNo" type="ed" width="100px"/>  
      <column id="default12" label="费用金额" ref="CostMoney" type="ed" width="100px"/>  
      <column id="default11" label="备注" ref="BZ" type="ed" width="100px"/>
    </xhtml:div>  
    <xhtml:div component="/UI/system/components/attachmentEditor2.xbl.xml#attachmentEditor2" display-buttons="upload:true;template:true;download:true;edit:true;delete:true;history:true;" limit="-1" runtime="html4" id="attachment" class="xui-attachmentEditor2" ref="data('dataMaster')/Attach"></xhtml:div><xhtml:div align="right" component="/UI/system/components/pagination.xbl.xml#pagination" data="dataMaster" first-label="首页" id="pagination1" items="first last pre next" last-label="尾页" next-label="下页" page-count="15" pre-label="上页"/>  
    <layout id="layout1" style="height:100%;width:800px;margin:auto;">
      <place control="flw" id="controlPlace7" style="width:24px;top:233px;left:16px;"/>  
      <xhtml:div component="/UI/system/components/buttonBar.xbl.xml#buttonBar" id="buttonBar1" separator="false" separator-size="16">
        <xui:place control="advanceTrigger" id="controlPlace6"/>  
        <xui:place control="saveTrigger" id="controlPlace8"/>  
        <xui:place control="menuButton1" id="controlPlace5"/>
      </xhtml:div>  
      <place control="vDetail" id="controlPlace1" style="width:100%;border-top:1px solid #B5B5B5;border-bottom:1px solid #B5B5B5;height:330px;"/>  
        
      <xui:place control="bizDataFilterMenu2" id="controlPlace10" style="top:47px;left:467px;"/>  
      <xhtml:div id="div1" style="padding:3px 3px 3px 3px;font-size:medium;font-family:微软雅黑;font-weight:bolder;">
相关文档:</xhtml:div>
<xui:place control="attachment" id="controlPlace11"></xui:place>
<xhtml:div id="div2" style="padding:3px 3px 3px 3px;font-size:medium;font-family:微软雅黑;font-weight:bolder;">预算信息:</xhtml:div>
<xhtml:div collapsed-label="隐藏过滤" component="/UI/system/components/buttonBar.xbl.xml#buttonBar" expandable="true" expanded="true" expanded-label="展开过滤" expanded-position="5" expanded-width="75" id="ngtbMaster1" separator="false" separator-size="1">
        <xui:place control="newTrigger" id="newTriggerPlace" />  
        <xui:place control="deleteTrigger" id="saveTriggerPlace" />  
        <xui:place control="refreshTrigger" id="refreshTriggerPlace" />  
        <xui:place control="queryTrigger" id="controlPlace3" />
      </xhtml:div>
      <place control="grdDetail" id="controlPlace2" style="width:100%;height:148px;"/>  
      <xui:place control="pagination1" id="controlPlace9"/>
    </layout>  
    <xforms:trigger appearance="image-minimal" component="/UI/system/components/trigger.xbl.xml#trigger" id="queryTrigger" operation="show" operation-owner="bizDataFilterMenu2">
      <xforms:label id="default1"/>
    </xforms:trigger>
  </xui:view>  
  <resource id="rsMain">
    <xhtml:script id="htmlScript1" src="mainActivity.js"/>
  </resource>
</window>

3

主题

14

帖子

51

积分

初级会员

Rank: 2

积分
51
QQ
 楼主| 发表于 2014-9-23 10:05:53 | 显示全部楼层
就是营销活动申请时有预算,其他的机会,项目也有预算,但这些在不同的表中,有个统一的预算表,希望在各业务保存时添加或更新相应的条目
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
35962
发表于 2014-9-23 10:24:48 | 显示全部楼层
如果没有用grid把bizdata的store-type设置为simple
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

310

主题

4938

帖子

4767

积分

论坛元老

Rank: 8Rank: 8

积分
4767
QQ
发表于 2014-9-23 10:25:43 | 显示全部楼层
lixg13 发表于 2014-9-23 10:05
就是营销活动申请时有预算,其他的机会,项目也有预算,但这些在不同的表中,有个统一的预算表,希望在各业务保 ...

bizDataBudget控件是否没有绑定grid?
QQ:179785966
回复 支持 反对

使用道具 举报

3

主题

14

帖子

51

积分

初级会员

Rank: 2

积分
51
QQ
 楼主| 发表于 2014-9-23 11:10:59 | 显示全部楼层
jishuang 发表于 2014-9-23 10:24
如果没有用grid把bizdata的store-type设置为simple

没有绑定grid,照这样,试了就好了,谢谢了
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-16 16:08 , Processed in 0.067487 second(s), 25 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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