NC 备料计划添加自定义按钮

1.自己找位置新建一个xml文件和一个类。

2.在客户端注册中心找到自己的功能节点中参数注册,添加上自己新建的xml文件路径。

参数名称为:非行业扩展的可增加参数名称为:PluginBeanConfigFilePath, 也 可使用: PluginBeanConfigFilePath_开始后面加字符 行业扩展参数名称:PluginBeanConfigFilePath_Industry行业编码 _CountryZone本地化编码,实现不同集团不同行业加载不同 的行业的扩展配置文件

 

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    
    <!-- 列表界面下增加导入按钮组 -->
     <bean class="nc.ui.pubapp.plugin.action.InsertActionInfo">
        <!-- cardEditorActions 列表界面下的按钮 --> 
        <property name="actionContainer" ref="actionsOfList" />
        <!-- 非编辑状态下 -->
        <property name="actionType" value="edit" />
        <!-- 目标按钮payMenuAction -->
        <property name="target" ref="printMenuAction" />  
        <!-- after为目标按钮之后 -->
        <property name="pos" value="after" />
        <!-- submitOaAction扩展的按钮 -->
        <property name="action" ref="addTestAction" />
    </bean> 

    <!-- 卡片界面下增加导入按钮组 -->
     <bean class="nc.ui.pubapp.plugin.action.InsertActionInfo">
        <!-- cardEditorActions 卡片界面下的按钮  -->
        <property name="actionContainer" ref="actionsOfCard" />
        <!-- 非编辑状态下 -->
        <property name="actionType" value="edit" />
        <!-- 目标按钮payMenuAction -->
        <property name="target" ref="replaceAction" />  
       <!--  after为目标按钮之后 -->
        <property name="pos" value="after" />
        <!-- addTestAction扩展的按钮 -->
        <property name="action" ref="addTestAction" />
    </bean> 
    

        <!-- 测试-->
    <bean id="addTestAction" class="nc.ui.mmpac.pickm.action.rxhk.AddTestAction">
           <property name="model" ref="manageAppModel" /> 
           
      <!-- <property name="model" ref="manageAppModel" />
        <property name="billForm" ref="billFormEditor" />
        <property name="listView" ref="listView" /> -->
    </bean>
</beans>

 按钮类

package nc.ui.mmpac.pickm.action.rxhk;



import java.awt.event.ActionEvent;



import nc.ui.pubapp.uif2app.query2.model.IModelDataManager;
import nc.ui.pubapp.uif2app.view.BillForm;
import nc.ui.uif2.NCAction;
import nc.ui.uif2.model.BillManageModel;
import nc.uif2.annoations.MethodType;
import nc.uif2.annoations.ViewMethod;
import nc.uif2.annoations.ViewType;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
public class AddTestAction extends  NCAction{

	private static final long serialVersionUID = 6648493618234538195L;
	private BillManageModel model;
	private BillForm editor;
	public AddTestAction(){
	//初始按钮名称和code
		super.setBtnName("测试按钮");
		//传入值和xml中的code对应
		super.setCode("addTestAction");
	}

	@Override
	public void doAction(ActionEvent  e) throws Exception {
		//super.doAction(e);
		AbstractBill aggVO = (AbstractBill) this.model.getSelectedData();
		//RegisterVO hvo = (RegisterVO) aggVO.getParentVO();
		//BillCardPanel panel = getEditor().getBillCardPanel();
		//panel.getHeadItem();
		//object.
		//BillItem[] hvo=panel.getHeadItems();
		// TODO 自动生成的方法存根
		//if (null != this.model.getSelectedData()) {

            // TODO 实现你的业务逻辑。
			ExceptionUtils.wrappBusinessException("qweqwe");
		//}
	}
	
	//按钮可不可用方法
		@Override
		protected boolean isActionEnable(){
		//设置按钮可见性
	 	return true;	
		}
		public BillManageModel getModel() {
			return model;
		}

		public void setModel(BillManageModel model) {
			this.model = model;
			//必须要加上这个监听,不然可能按钮出不来
			this.model.addAppEventListener(this);
		}
		
		@ViewMethod(viewType = ViewType.BillForm, methodType = MethodType.GETTER)
		public BillForm getEditor() {
			return this.editor;
		}

		
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值