NC6系列加按钮

mac2025-04-13  14

1.找到对应的config.xml文件 再对应的位置配置按钮的引用(想在哪里显示按钮就在哪里添加配置) 如:

列表显示下的按钮 <bean id="actionsOfList" ... ... <!-- 自定义按钮的引用 --> <ref bean="diyoneAction" /> 卡片显示下的按钮 <bean id="actionsOfCard" ... ... <!-- 自定义按钮的引用 --> <ref bean="diytwoAction" /> <!--======= 动作:自定义按钮1 ====采用代码注册=======--> <bean id="diyoneAction" class="nc.ui.test.bill.action.DiyoneAction"> //配置model,editor,相对应的DiyoneAction类也要添加属性,并添加get,set方法 <property name="model"><ref bean="bmModel"/></property> <property name="editor"><ref bean="billForm"/></property> </bean> <!--======= 动作:自定义按钮2 ====采用配置注册=======--> <bean id="diytwoAction" class="nc.ui.test.bill.action.DiytwoAction"> <property name="model"><ref bean="bmModel"/></property> <property name="editor"><ref bean="billForm"/></property> //需要配置以下属性,按钮编码和按钮名字,随便取 <property name="code" value="diytwoAction"></property> <property name="btnName" value="导出Excel"></property> </bean>

2.然后新建按钮对应的类 代码注册按钮时,需要在类中加入无参构造

//采用代码赋值注册按钮 public DiyoneAction() { ActionInitializer.initializeAction(this, "DiyoneAction", "按钮名"); //参数列表, //this(当前对象),按钮编码,按钮名字 }
最新回复(0)