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

QQ登录

只需一步,快速开始

查看: 23223|回复: 29

[结贴] 主从表对话框的问题

[复制链接]

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
发表于 2018-7-24 11:44:04 | 显示全部楼层 |阅读模式
版本: 小版本号:
数据库: 服务器操作系统: 应用服务器:
客户端操作系统: 浏览器:
以主表建对话框页面的话,从表的数据就传不回去,就算windowDialog mapping 选的是从表概念。而且主表搜索出来后,不会出现对应从表的值。

但以从表建立的话,搜索功能就不能用了。


91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36196
发表于 2018-7-24 13:27:55 | 显示全部楼层
不用模板向导,自己创建一个页面,设置主从,然后用windowDialog去关联这个页面操作看看
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
 楼主| 发表于 2018-7-24 16:13:54 | 显示全部楼层
jishuang 发表于 2018-7-24 13:27
不用模板向导,自己创建一个页面,设置主从,然后用windowDialog去关联这个页面操作看看 ...
  1.        
  2. 刷新数据失败! ,
  3. 执行KSQL出错, KSQL: SELECT BASE_car.* FROM BASE_car BASE_car WHERE (((upper(BASE_cartree.fName) LIKE '%东%'))) LIMIT 0, 20
  4. --> sql:
  5. --> binds: []
  6. 编码:JUSTEP150210
  7. 隐藏详细
  8. java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) 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 com.justep.micro.service.MicroServiceFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 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: 编码: JUSTEP150210; 提示: 执行KSQL出错, KSQL: SELECT BASE_car.* FROM BASE_car BASE_car WHERE (((upper(BASE_cartree.fName) LIKE '%东%'))) LIMIT 0, 20 --> sql: --> binds: [] at com.justep.exception.BusinessException.create(Unknown Source) at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source) at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source) at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source) at com.justep.system.data.BizData.query(Unknown Source) at BizProcedure.query(BizProcedure.java:12) ... 29 more Caused by: com.justep.exception.BusinessException: 编码: JUSTEP154041; 提示: KSQL语法错误, 未声明的符号BASE_cartree.fName at com.justep.exception.BusinessException.create(Unknown Source) at com.justep.util.Utils.check(Unknown Source) at com.justep.system.ksql.parser.AbstractParser.checkSymTable(Unknown Source) at com.justep.system.ksql.parser.AbstractParser.parse(Unknown Source) ... 34 more
复制代码

在查询时遇到这个错误
回复 支持 反对

使用道具 举报

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
 楼主| 发表于 2018-7-24 16:13:58 | 显示全部楼层
本帖最后由 ef61 于 2018-7-24 16:22 编辑

process加了两个查询action了
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36196
发表于 2018-7-24 17:14:27 | 显示全部楼层
操作的都不是一个概念
sql.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
 楼主| 发表于 2018-7-25 09:51:07 | 显示全部楼层
本帖最后由 ef61 于 2018-7-25 09:54 编辑
jishuang 发表于 2018-7-24 17:14
操作的都不是一个概念
  1. <?xml version="1.0" encoding="utf-8"?>

  2. <div xmlns="http://www.w3.org/1999/xhtml" component="$UI/system/components/justep/window/window" xid="window" design="device:pc;">  
  3.   <div component="$UI/system/components/justep/model/model" xid="model" style="height:auto;left:463px;top:331px;">
  4.     <div component="$UI/system/components/justep/data/bizData" xid="dialogData"
  5.       autoLoad="true" autoNew="false" concept="BASE_cartree" columns=""
  6.       isTree="true">
  7.       <reader action="/carFin/base/logic/action/queryBASE_cartreeAction"/>
  8.       <treeOption parentRelation="fBaCarTreeUplink" nodeKindRelation=""
  9.         rootFilter=""/>
  10.     </div>
  11.     <div component="$UI/system/components/justep/data/bizData" xid="searchData"
  12.       autoLoad="true" autoNew="false" concept="BASE_car" isTree="false">
  13.       <reader action="/carFin/base/logic/action/queryBASE_carAction"/>
  14.     </div>
  15.   <div component="$UI/system/components/justep/data/bizData" autoLoad="true" xid="carData" concept="BASE_car"><reader xid="default1" action="/carFin/base/logic/action/queryBASE_carAction"></reader>
  16.   <master xid="default2" data="dialogData" relation="fBaCarDetailUplink"></master></div></div>  
  17.   <span component="$UI/system/components/justep/windowReceiver/windowReceiver"
  18.     xid="windowReceiver" style="top:2px;left:606px;" onReceive="windowReceiverReceive"/>  
  19.   <div component="$UI/system/components/justep/panel/panel" class="x-panel x-full"
  20.     xid="panel1">
  21.     <div class="x-panel-top" xid="top2">
  22.       <div component="$UI/system/components/bootstrap/row/row" class="row"
  23.         xid="row1">
  24.         <div class="col col-xs-6 col-md-4" xid="col1">
  25.           <div component="$UI/system/components/justep/smartFilter/smartFilter"
  26.             xid="smartFilter1" filterData="dialogData" filterCols="fName" onFilter="smartFilterFilter">
  27.             <input type="text" class="form-control" placeholder="搜索" data-bind="valueUpdate: ['input', 'afterkeydown']"
  28.               bind-value="$model.comp($element.parentElement).searchText" bind-change="$model.comp($element.parentElement).onInputChange.bind($model.comp($element.parentElement))"
  29.               xid="input1"/>
  30.           </div>
  31.         </div>
  32.       </div>
  33.     </div>  
  34.     <div class="x-panel-content" xid="content1">
  35.         
  36.       
  37.     <div component="$UI/system/components/bootstrap/row/row" class="row" xid="row2">
  38.    <div class="col col-xs-4" xid="col2"><div style="height:100%;overflow-x: hidden;" bind-visible="!showFilterGird.get()" class="x-bordered">
  39.         <div component="$UI/system/components/justep/grid/grid" appearance="tree" data="dialogData" expandColumn="fName" useVirtualRoot="true" virtualRootLabel="车辆品牌" xid="treeGrid" class="x-grid-no-bordered" height="auto" width="100%" onRowClick="treeGridRowClick">
  40.           <columns xid="columns2">
  41.             <column name="fName" />
  42.           </columns>
  43.         </div>
  44.       </div><div class="x-bordered" style="display:none;height:0;" bind-visible="showFilterGird" xid="searchDiv">
  45.         <div component="$UI/system/components/justep/dataTables/dataTables" flexibleWidth="true" data="searchData" rowActiveClass="active" class="table" xid="searchGrid" scrollCollapse="false" ordering="false" lengthMenu="20" onRowSelect="searchGridRowSelect">
  46.           <columns>
  47.             <column name="fName" />
  48.           </columns>
  49.         </div>
  50.       </div></div>
  51.    <div class="col col-xs-4" xid="col4"><div component="$UI/system/components/justep/dataTables/dataTables" flexibleWidth="true" data="carData" rowActiveClass="active" class="table" xid="dataTables" scrollCollapse="false" ordering="false" lengthMenu="20" onRowSelect="dataTablesRowSelect">
  52.    <columns xid="columns1">
  53.     <column name="fName" xid="column1"></column></columns> </div></div></div></div>  
  54.     <div class="x-panel-bottom" xid="bottom1" height="42">
  55.       <a component="$UI/system/components/justep/button/button" class="btn btn-link btn-only-label x-dialog-button"
  56.         label="取消" xid="cancelBtn" onClick='{"operation":"windowReceiver.windowCancel"}'>
  57.         <i xid="i2"/>  
  58.         <span xid="span2">取消</span>
  59.       </a>  
  60.       <a component="$UI/system/components/justep/button/button" class="btn btn-primary x-dialog-button"
  61.         label="确定" xid="OKBtn" onClick="OKBtnClick" bind-enable="canOK">
  62.         <i xid="i1"/>  
  63.         <span xid="span1">确定</span>
  64.       </a>
  65.     </div>
  66.   </div>
  67. </div>
复制代码
  1. define(function(require){
  2.         var $ = require("jquery");
  3.         var justep = require("$UI/system/lib/justep");
  4.         var Data = require("$UI/system/components/justep/data/data");

  5.         var Model = function(){
  6.                 this.showFilterGird = justep.Bind.observable(false);
  7.                 this.initOK = justep.Bind.observable(false);
  8.                 this.result = justep.Bind.observable();
  9.                
  10.                 this.canOK = justep.Bind.computed(function(){
  11.                         if(!this.initOK.get()) return false;
  12.                         if(this.getSelected()) return true;
  13.                         else return false;
  14.                 },this);
  15.                
  16.                 this.callParent();
  17.         };

  18.         Model.prototype.getSelected = function(){
  19.                 return this.result.get();
  20.         };
  21.         
  22.         Model.prototype.OKBtnClick = function(event){
  23.                 this.comp('windowReceiver').windowEnsure(this.getSelected());
  24.         };

  25.         Model.prototype.getTreeData = function(){
  26.                 return this.comp('dialogData');
  27.         };
  28.         
  29.         Model.prototype.setSelected = function(selected) {
  30.                 return this.result.set(selected);
  31.         };
  32.         
  33.         Model.prototype.windowReceiverReceive = function(event){
  34.                 if (event.data) {
  35.                         if (event.data.selected) {
  36.                                 this.comp('dataTables').setSelection(event.data.selected);
  37.                         }
  38.                 }
  39.                 this.initOK.set(true);
  40.         };
  41.         
  42.         Model.prototype.smartFilterFilter = function(event){
  43.                 var filter = event.source;
  44.                 var v = filter.getFilterStr();
  45.                 var selectedRow = null;
  46.                 if(v){
  47.                         this.showFilterGird.set(true);
  48.                         $(this.getElementsByXid('searchDiv')).css({height:'100%',position: 'relative'});
  49.                         var searchData = this.comp('searchData');
  50.                         searchData.setFilter(filter.getFilterFlag(), filter.getFilterStr());
  51.                         searchData.refreshData();
  52.                         selectedRow = searchData.getCurrentRow();
  53.                 }else{
  54.                         this.showFilterGird.set(false);
  55.                         $(this.getElementsByXid('searchDiv')).css({height:0,position: 'absolute'});
  56.                         this.comp('treeGrid').autoSize();
  57.                         selectedRow = null;
  58.                 }
  59.                 this.setSelected(selectedRow);
  60.         };
  61.         
  62.         Model.prototype.treeGridRowClick = function(event){
  63.                 this.setSelected(this.getTreeData().getRowByID(event.rowID));
  64.         };
  65.         
  66.         Model.prototype.searchGridRowSelect = function(event){
  67.                 this.setSelected(event.row);
  68.         };
  69.         
  70.         Model.prototype.dataTablesRowSelect = function(event){
  71.                 this.setSelected(event.row);
  72.         };
  73.         
  74.         return Model;
  75. });
复制代码
现在做的还是在模板上改的,不知道查询这个在哪里修改
carData是从表。

回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36196
发表于 2018-7-25 10:19:03 | 显示全部楼层
组件关联的data正确吗?事件中操作的data正确吗?
smartFilter.png
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
 楼主| 发表于 2018-7-25 11:08:37 | 显示全部楼层
jishuang 发表于 2018-7-25 10:19
组件关联的data正确吗?事件中操作的data正确吗?

searchData那里没改的问题。
但搜索后,点击主表就不会出现对应的从表数据。
回复 支持 反对

使用道具 举报

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36196
发表于 2018-7-25 11:19:31 | 显示全部楼层
把sql语句打看从表执行的sql是什么
http://bbs.wex5.com/forum.php?mo ... 4&pid=165004035
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



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

使用道具 举报

15

主题

79

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
 楼主| 发表于 2018-7-25 11:43:45 | 显示全部楼层
  1. 2018-07-25 11:40:28 [SQL Time]sql 执行时间:19ms, exec KSQL: SELECT BASE_cartree.*  FROM BASE_cartree BASE_cartree WHERE (((upper(BASE_cartree.fName) LIKE '%东%'))) LIMIT 0, 20
  2.   --> sql:SELECT  BASE_cartree.fID AS BASE_cartree, BASE_cartree.FBACARTREEUPLINK AS fBaCarTreeUplink, BASE_cartree.FCARTHREEID AS fCarThreeid, BASE_cartree.FCODE AS fCode, BASE_cartree.FCOMPANY AS fCompany, BASE_cartree.FCREATETIME AS fCreateTime, BASE_cartree.FCREATEUSER AS fCreateUser, BASE_cartree.FDESCRIPTION AS fDescription, BASE_cartree.FGROUPNAME AS fGroupName, BASE_cartree.FISLEAF AS fIsLeaf, BASE_cartree.FLASTUPDATETIME AS fLastUpdateTime, BASE_cartree.FLASTUPDATEUSER AS fLastUpdateUser, BASE_cartree.FLEVEL AS fLevel, BASE_cartree.FLONGNAME AS fLongName, BASE_cartree.FLONGNUMBER AS fLongNumber, BASE_cartree.FNAME AS fName, BASE_cartree.FNUMBER AS fNumber, BASE_cartree.FSTATUS AS fStatus, BASE_cartree.FSYNCTIME AS fSyncTime FROM base_cartree BASE_cartree  WHERE UPPER(BASE_cartree.FNAME) LIKE ?
  3. --> binds:[%东%]
  4. 2018-07-25 11:40:28 [SQL Time]sql 执行时间:5ms, exec KSQL:
  5.   --> sql:SELECT count(*) FROM base_cartree BASE_cartree  WHERE UPPER(BASE_cartree.FNAME) LIKE ?
  6. --> binds:[%东%]
复制代码


搜索后没有从表的select操作
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-8-19 06:25 , Processed in 0.071445 second(s), 27 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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