您的位置:首页 > 其它

nc65用友uap开发节点通过按钮调用打开另外一个节点并传数据跳编辑态(推单)

2016-12-19 19:21 579 查看
nc65用友uap开发节点通过按钮调用打开另外一个节点并传数据跳编辑态(推单)
目标:如图所示,通过合同续约按钮调用打开合同管理中心节点,并且把相应数据传入到合同管理中心节点(编辑态)



1.按钮代码:
package nc.ui.fdc_pr.h303113510.actions;

import java.awt.event.ActionEvent;

import nc.desktop.ui.WorkbenchEnvironment;
import nc.funcnode.ui.FuncletInitData;
import nc.funcnode.ui.FuncletWindowLauncher;
import nc.ui.fdc_pr.h303202005.ace.handler.InitDataUtil;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.model.AbstractAppModel;
import nc.vo.fdc_pr.h303113510.AggRentPact;
import nc.vo.sm.funcreg.FuncRegisterVO;
/**
*
* @author: zenglong
* @ClassName: ContracttAction
* @Description: 续约合同按钮
* @date: 2016年12月18日
*/
public class ContracttAction extends NCAction {

private static final long serialVersionUID = 9169939802794646069L;
private AbstractAppModel model;
public AbstractAppModel getModel() {
return model;
}
public void setModel(AbstractAppModel model) {
this.model = model;
}
public ContracttAction(){
setBtnName("合同续约");
setCode("contractt");
}
@Override
public void doAction(ActionEvent e) throws Exception {
AggRentPact aggRent=(AggRentPact) this.getModel().getSelectedData();
if (aggRent==null || aggRent.equals("")) {
MessageDialog.showErrorDlg(getModel().getContext().getEntranceUI(),"错误","请选中行后进行操作");
return;
}

FuncRegisterVO funvo = WorkbenchEnvironment.getInstance().getFuncRegisterVO("H303113510");
FuncletWindowLauncher.openFuncNodeInTabbedPane(null, funvo, getInitData(aggRent), null, true);
}

public FuncletInitData getInitData(AggRentPact aggRent){
FuncletInitData data  = new FuncletInitData();

data.setInitData(aggRent);
data.setInitType(-1);
return data;
}
}
2.需要打开节点的xml配置文件中,修改初始化监听

<!-- 打开节点监听 newadd-->
<bean id="InitDataListener" class="nc.ui.fdc_pr.h303113510.ace.handler.MyDefaultFuncNodeInitDataListener">
<property name="model" ref="bmModel"/>
<property name="context" ref="context"></property>
<property name="voClassName" value="nc.vo.fdc_pr.h303113510.AggRentPact"/>
<property name="billform" ref="billForm"></property>
<property name="defaultUIF2RefEditor">
<ref bean="defaultUIF2RefEditor" />
</property>
</bean>
<!-- 导入编辑器 -->
<bean id="defaultUIF2RefEditor" class="nc.itf.fdc.pub.DefaultUIF2RefEditor">
<property name="addAction" ref="addAction" />
<property name="billcardPanelEditor" ref="billForm" />
<property name="appModel" ref="bmModel" />
</bean>



3.节点初始化监听类


package nc.ui.fdc_pr.h303113510.ace.handler;

import nc.funcnode.ui.FuncletInitData;
import nc.itf.fdc.pub.DefaultUIF2RefEditor;
import nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener;
import nc.ui.pubapp.uif2app.view.ShowUpableBillForm;
import nc.vo.fdc_pr.h303113510.AggRentPact;
import nc.vo.fdc_pr.h303202005.AggRevfare;

/**
*
* @author: zenglong
* @ClassName: MyDefaultFuncNodeInitDataListener
* @Description: 节点打开初始化数据
* @date: 2016年12月18日
*/
public class MyDefaultFuncNodeInitDataListener extends DefaultFuncNodeInitDataListener {

ShowUpableBillForm billform;
private DefaultUIF2RefEditor defaultUIF2RefEditor = null;
public void initData(FuncletInitData data) {
if (null == data) {
this.getModel().initModel(null);
re
c7e7
turn;
}
//用参数中传过来的数据初始化AppModel,可能会转换成VO或VO数组,根据业务确定
AggRentPact initData =(AggRentPact) data.getInitData();
//调用添加按钮
getDefaultUIF2RefEditor().addNew();
//初始化数据
getDefaultUIF2RefEditor().setValue(initData);
}
public ShowUpableBillForm getBillform() {
return billform;
}
public void setBillform(ShowUpableBillForm billform) {
this.billform = billform;
}
public DefaultUIF2RefEditor getDefaultUIF2RefEditor() {
return defaultUIF2RefEditor;
}
public void setDefaultUIF2RefEditor(DefaultUIF2RefEditor defaultUIF2RefEditor) {
this.defaultUIF2RefEditor = defaultUIF2RefEditor;
}

}
4.
package nc.itf.fdc.pub;

import nc.ui.pub.bill.BillData;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.editor.IBillCardPanelEditor;
import nc.ui.uif2.model.AbstractUIAppModel;
import nc.vo.pub.AggregatedValueObject;

public  class DefaultUIF2RefEditor  {

private NCAction addAction = null;

private Exception ex;    //保存过程中通过拦截器将异常抛出

private IBillCardPanelEditor billcardPanelEditor = null;

private AbstractUIAppModel appModel = null;

protected NCAction createAddAction()
{
return null;
}

protected NCAction createSaveAction()
{
return null;
}

protected NCAction createCancelAction()
{
return null;
}

protected IBillCardPanelEditor createBillCardPanelEditor()
{
return null;
}

protected AbstractUIAppModel createAppModel()
{
return null;
}

/**
* 新增操作
*
* @see nc.itf.trade.excelimport.IImportableEditor#addNew()
*/
public void addNew() {
try {
getAddAction().actionPerformed(null);
} catch (Exception e) {
nc.bs.logging.Logger.error(e.getMessage());
}
}

/**
* 设值操作
*
* 标准的操作步骤如下:
* 1,转型VO为ExtendedAggregatedValueObject
* 2,根据转换规则处理VO的相关属性值
* 3,将处理后的VO值设置到界面上
*/
public void setValue(Object obj) {
if(getBillcardPanelEditor() != null)
{
BillData bd = getBillcardPanelEditor().getBillCardPanel().getBillData();
bd.setBillValueVO((AggregatedValueObject)obj);
}
}

/**
* 返回AddAction对象
*/
public NCAction getAddAction() {

if(addAction == null)
addAction = createAddAction();
return this.addAction;
}

public void setAddAction(NCAction addAction) {
this.addAction = addAction;
}

public IBillCardPanelEditor getBillcardPanelEditor() {

if(billcardPanelEditor == null)
billcardPanelEditor = createBillCardPanelEditor();
return billcardPanelEditor;
}

public void setBillcardPanelEditor(IBillCardPanelEditor billcardPanelEditor) {
this.billcardPanelEditor = billcardPanelEditor;
}

public AbstractUIAppModel getAppModel() {

if(this.appModel == null)
appModel = createAppModel();
return appModel;
}

public void setAppModel(AbstractUIAppModel model) {
this.appModel = model;
}

public int getExportCount() {
return 1;
}

public Exception getEx() {
return ex;
}

public void setEx(Exception ex) {
this.ex = ex;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐