NC单据字段加超链接

与世无争的帅哥 提交于 2020-01-07 03:48:02

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

  1. 修改配置文件:

<!-- 打开节点监听 newadd-->

<!-- 
 <bean id="InitDataListener" class="nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener">
	<property name="model" ref="bmModel"/>
	<property name="context" ref="context"></property>
	<property name="voClassName" value="nc.vo.am.deptdeclaration.AggDeptdeclarationHVO"/>
</bean>
-->
<bean id="InitDataListener" class="nc.ui.deptdeclaration.ace.listener.LinkFileconsultapplyInitDataListener">
	<property name="model" ref="bmModel"/>
	<property name="context" ref="context"></property>
	<!--class为此类的实体类位置 -->
	<property name="voClassName" value="nc.vo.am.deptdeclaration.AggDeptdeclarationHVO"/>
	<property name="cardView" ref="billForm"></property>
	<property name="listView" ref="billListView" />
</bean>
  1. 新建类继承DefaultFuncNodeInitDataListener public class LinkFileconsultapplyInitDataListener extends DefaultFuncNodeInitDataListener {

     private ShowUpableBillListView listView;
     private ShowUpableBillForm  cardView;
    
    
     public ShowUpableBillListView getListView() {
             return listView;
     }
    
     public void setListView(ShowUpableBillListView listView) {
             this.listView = listView;
     }
    
     public ShowUpableBillForm getCardView() {
     	return cardView;
     }
    
     public void setCardView(ShowUpableBillForm cardView) {
     	this.cardView = cardView;
     }
     [@Override](https://my.oschina.net/u/1162528)
     public void initData(FuncletInitData data) {
             // TODO 自动生成的方法存根
             super.initData(data);
    
             getCardView().getBillCardPanel().getBodyItem("bdef1")//当前表参照的字段(卡片)
             .addBillItemHyperlinkListener(new LinkFileconsultapplyListener(getCardView().getBillCardPanel()));
    
             getListView().getBillListPanel().getBodyItem("bdef1")//当前表参照的字段(列表)
             .addBillItemHyperlinkListener(new LinkFileconsultapplyListener(getListView().getBillListPanel()));
     }		
    

}

  1. 新建类实现 BillItemHyperlinkListener ` public class LinkFileconsultapplyListener implements BillItemHyperlinkListener{

     private BillCardPanel billCardPanel;
     private BillListPanel billListPanel;
    
     public LinkFileconsultapplyListener(BillCardPanel billCardPanel) {
             this.billCardPanel=billCardPanel;
     }
    
     public LinkFileconsultapplyListener(BillListPanel billListPanel) {
             this.billListPanel=billListPanel;
     }
    
     public BillCardPanel getBillCardPanel() {
     	return billCardPanel;
     }
    
     public void setBillCardPanel(BillCardPanel billCardPanel) {
     	this.billCardPanel = billCardPanel;
     }
    
     public BillListPanel getBillListPanel() {
     	return billListPanel;
     }
    
     public void setBillListPanel(BillListPanel billListPanel) {
     	this.billListPanel = billListPanel;
     }
    
     public void hyperlink(BillItemHyperlinkEvent event) {
             //联查打开档案
     	//合同超链接实现
     	LinkQueryData data = new LinkQueryData();
     	if ("bdef1".equals(event.getItem().getKey())) {
     		if(billCardPanel!=null){
     			String billIDText=event.getValue().toString();
     		    String sqlBillid= "select pk_equip from pam_equip where equip_code = '"+billIDText+"' and nvl(dr,0)=0";
     		    IUAPQueryBS lookup = NCLocator.getInstance().lookup(IUAPQueryBS.class);
     			String billID =null;
     			try {
     				billID = (String) lookup.executeQuery(sqlBillid, new ColumnProcessor());
     			} catch (BusinessException e) {
     				e.printStackTrace();
     			}
     			String pkOrg=(String)billCardPanel.getHeadItem("pk_org").getValueObject();
     			data.setBillID(billID);
     			data.setBillType("AM01");
     			data.setPkOrg(pkOrg);
     			SFClientUtil.openLinkedQueryDialog("4510016005404", billCardPanel, data);
    
     		}
     	    if(billListPanel!=null){
     	    	String billIDText=event.getValue().toString();
     		    String sqlBillid= "select pk_equip from pam_equip where equip_code = '"+billIDText+"' and nvl(dr,0)=0";
     		    IUAPQueryBS lookup = NCLocator.getInstance().lookup(IUAPQueryBS.class);
     			String billID =null;
     			try {
     				billID = (String) lookup.executeQuery(sqlBillid, new ColumnProcessor());
     			} catch (BusinessException e) {
     				e.printStackTrace();
     			}
     			String pkOrg=(String)billCardPanel.getHeadItem("pk_org").getValueObject();
     			data.setBillID(billID);
     			data.setBillType("AM01");
     			data.setPkOrg(pkOrg);
     			SFClientUtil.openLinkedQueryDialog("4510016005404", billListPanel, data);
            }
     }
    

    }`

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!