|
如图,界面上主表用的是标准的bizQueryAction,从表是我自己写的queryAction,已经设置了主从关系
但跟踪发现,点上面的查询的时候,从表只会查出主表的第一条数据,当光标移动到主表其它行的时候,从表不会跟着改变
Action代码:
- public static Table queryAccountList(String concept,String idColumn,String select,String from,String condition,
- List range,String filter,Boolean distinct,Integer offset,Integer limit,
- String columns,String orderBy,String aggregate,String aggregateColumns,Map variables,
- String dataModel,String fnModel,String vBegin,String vEnd){
-
- try {
- String where = "";
- if(filter != null && !"".equals(filter)){
- where = " and (" + filter+")";
- }
-
- String sql = "";
- sql = "select OA_AttRelation.fid as fID,OA_AttRelation.fRelationID as fRelationID,OA_AttRelation.fTranType as fTranType,OA_AttRelation.fClientAccount as fClientAccount," +
- "OA_AttRelation.fRecordNo as fRecordNo,OA_AttRelation.fBIZKIND as fBIZKIND,OA_AttRelation.fApplyPreUrl as fApplyPreUrl,OA_AttRelation.fApplyPsnID as fApplyPsnID," +
- "OA_AttRelation.fApplyPsnCode as fApplyPsnCode,OA_AttRelation.fApplyPsnName as fApplyPsnName,OA_AttRelation.fApplyDuty as fApplyDuty,OA_AttRelation.fApplyDate as fApplyDate," +
- "OA_AttRelation.fPlanHours as fPlanHours,OA_AttRelation.fExplain as fExplain,OA_AttRelation.fYDayHours as fYDayHours,OA_AttRelation.fUsedHours as fUsedHours," +
- "OA_AttRelation.fRemark as fRemark,case when OA_AttRelation.fPlanHours<0 then null else OA_AttRelation.fPlanHours end as fIn," +
- "case when OA_AttRelation.fPlanHours<0 then OA_AttRelation.fPlanHours*-1 else null end as fOut from OA_AttRelation OA_AttRelation " +
- "where convert(varchar(10),fApplyDate,120)>=? and convert(varchar(10),fApplyDate,120)<=? "+where+" order by fApplyDate asc" ;
-
- List<Object> list = new ArrayList<Object>();
- list.add(vBegin);
- list.add(vEnd);
-
- Map<String, String> sqlMap = new HashMap<String, String>();
- sqlMap.put(DatabaseProduct.MSSQL.name(), sql);
- Table table=SQL.select(sqlMap, list, DATA_MODEL);
- table.getProperties().put(Table.PROP_NAME_ROWID, "fID");
-
- return table;
-
- } catch (Exception e) {
- System.out.println("ds.createVersion Exception:" + e.getMessage());
- return null;
- }
- }
复制代码 可不可以像标准动作一样,点击主表相应的行,从表跟着改变,而不用自己在主表发生改变时写从表刷新语句呢??
|
|