【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
- 修改配置文件:
<!-- 打开节点监听 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>
-
新建类继承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())); }
}
-
新建类实现 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); } }
}`
来源:oschina
链接:https://my.oschina.net/u/4276394/blog/3152686