用友nc65 uap开发参照多选后显示问题解决
2017-01-17 23:33
861 查看
用友nc65 uap开发参照多选后显示问题解决
前面一篇博客中已经提到了参照面板选中多个,但是选中多个后无法在显示在面板上。此时我们应该对其做些处理。主要思路是拿到参照面板的主键,用逗号隔开保存到数据库,显示的时候用逗号分割取出来。
1.保存到数据库时用逗号隔开
需要重写billListView
前面一篇博客中已经提到了参照面板选中多个,但是选中多个后无法在显示在面板上。此时我们应该对其做些处理。主要思路是拿到参照面板的主键,用逗号隔开保存到数据库,显示的时候用逗号分割取出来。
1.保存到数据库时用逗号隔开
SplitPact[] splitVos = (SplitPact[]) vo.getChildren(SplitPact.class); if (splitVos != null && splitVos.length > 0) { String houseTemp = ""; String strTemp1 = ""; for (int i = 0; i<splitVos.length; i++) { if(!strTemp1.equals((String)splitVos[i].getPk_house())) houseTemp = houseTemp+(String)splitVos[i].getPk_house()+","; strTemp1 = (String)splitVos[i].getPk_house(); } houseTemp = houseTemp.substring(0, houseTemp.length()-1); // 将用逗号隔开的数据保存到房产字 c987 段 bill.setAttributeValue("pk_allhouses", houseTemp);2.打开面板时,显示:
需要重写billListView
<!--====== 视图元素:[PUBAPP列表视图控件(ShowUpableBillListView)实例对象] ============== --> <bean id="billListView" class="nc.ui.fdc_pr.h303201525.ace.view.BillNewListView" init-method="initUI"> <property name="model"> <ref bean="bmModel" /> </property> <property name="multiSelectionEnable" value="true" /> <property name="multiSelectionMode" value="1" /> <property name="templateContainer" ref="templateContainer" /> </bean>billListView类代码:
package nc.ui.fdc_pr.h303201525.ace.view; import java.util.List; import nc.ui.pub.beans.UIRefPane; import nc.ui.pub.beans.constenum.DefaultConstEnum; import nc.ui.pub.bill.BillListData; import nc.ui.pub.bill.BillListPanel; import nc.ui.pubapp.uif2app.view.ShowUpableBillListView; import nc.ui.uif2.AppEvent; import nc.ui.uif2.model.BillManageModel; import nc.vo.fdc_pr.h303201525.AggBill; import nc.vo.fdc_pr.h303201525.Bill; import nc.vo.pub.CircularlyAccessibleValueObject; public class BillNewListView extends ShowUpableBillListView{ private static final long serialVersionUID = 1L; @Override public void initUI() { super.initUI(); flag = false; } @Override public void handleEvent(AppEvent event) { super.handleEvent(event); showMultHoseOrCust(event); } boolean flag = false; public void showMultHoseOrCust(AppEvent event) { List dlist = getModel().getData();//获得面板数据 if(dlist==null||dlist.size()==0)return; int rows=getBillListPanel().getHeadTable().getRowCount(); for (int i = 0; i < rows; i++){ //获得当前行vo CircularlyAccessibleValueObject hvo = getBillListPanel().getHeadBillModel().getBodyValueRowVO(i, Bill.class.getName()); String pk_head=hvo.getAttributeValue("pk_head")+""; //大于5因为null if(pk_head==null||pk_head.trim().length()<5)continue; String pkhous=""; String build=""; for(int h=0;h<dlist.size();h++){ Object billvo = dlist.get(h); if(billvo==null){ continue; } if(billvo instanceof AggBill){ AggBill aggvo = (AggBill)billvo; String pkhead = aggvo.getParentVO().getPrimaryKey(); if(pk_head.trim().equals(pkhead.trim())){ //取出要分割的参照数据 pkhous = aggvo.getParentVO().getPk_allhouses(); build = aggvo.getParentVO().getBuild(); break; } } } if(pkhous==null||pkhous.trim().length()<5)continue; String[] resultpks = pkhous.split(",");//拆分 UIRefPane refPene =(UIRefPane) getBillListPanel().getHeadItem("pk_allhouses").getComponent(); refPene.setPKs(resultpks); DefaultConstEnum refEnum = new DefaultConstEnum(pkhous, refPene.getRefShowName()); getBillListPanel().getHeadBillModel().setValueAt(refEnum, i, "pk_allhouses");//赋值 if(build==null||build.trim().length()<5){ continue; } String[] buildpks = build.split(","); UIRefPane buildrefPene =(UIRefPane) getBillListPanel().getHeadItem("build").getComponent(); buildrefPene.setPKs(buildpks); DefaultConstEnum buildrefEnum = new DefaultConstEnum(build, buildrefPene.getRefShowName()); getBillListPanel().getHeadBillModel().setValueAt(buildrefEnum, i, "build"); } flag = true; } }
相关文章推荐
- 用友nc65 uap开发参照多选三种显示情况总结
- 用友nc65 uap开发跳转编辑状态自动赋值参照值无法带出解决办法
- 用友nc65 uap开发中系统出现卡,慢等问题解决思路一(临时合同节点处理)
- 用友nc65 uap开发中系统出现卡,慢等问题解决思路二(提交审批等按钮卡慢)
- 用友uap nc65开发-使用自定义公式解决参照多显问题
- 用友nc65 uap开发参照节点数据拉单之一
- 用友nc65 uap开发如何将一个vo单据显示在一个弹窗面板上?
- 用友uap nc65开发对于集团级节点和业务单元级节点中的一打开左侧树显示的问题解决
- 用友nc65 uap开发参照节点数据拉单之二----直接通过调用查询模版查询上游单据
- nc65用友nap开发-参照多选和多选后根据多选后的参照自动增加行
- 用友nc65 uap开发对于小数显示百分号开发
- 解决Eclipse进行Android开发时logcat不显示问题-使用DDMS
- 开发win8 metro monogame,显示pubcenter广告时会使游戏卡住的问题的解决方法。
- 解决Eclipse进行Android开发时logcat不显示问题-使用DDMS
- Win7 VS2010下开发的CS软件,安装到XP下无法运行或者桌面快捷方式无法显示图标的问题解决方法
- [置顶] 解决Eclipse进行Android开发时logcat不显示问题-使用DDMS
- 解决Android平板电脑上开发应用程序不能全屏显示的问题
- vs开发的程序在xp下显示 xxx.exe不是有效的win32程序问题解决
- 解决ListView上多选和单选界面上显示错乱的问题
- MyEclipse+Tomcat开发Web项目时修改内容不能及时显示问题解决方法