NC65单表单据添加数据勾选事件

在XML文件事件监听的bean中添加数据勾选事件,同时实现:如果勾选了一条数据,通过勾选数据行中的单据号查找整个列表界面的数据,如果有数据行的单据号跟我选择的那行数据的单据号相同的话,那相同的那行数据也一起设置勾选状态(如果是取消勾选,则同样取消勾选单据号相同的行数据)。

<!-- 事件监听newadd -->
<bean id="bmModelEventMediator" class="nc.ui.pubapp.uif2app.model.AppEventHandlerMediator">
	<property name="model" ref="bmModel" />
	<property name="handlerGroup">
		<list>
			<!-- nc.ui.pubapp.uif2app.event.OrgChangedEvent -->
			<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
				<property name="event" value="nc.ui.pubapp.uif2app.event.OrgChangedEvent" />
				<property name="handler">
					<bean class="nc.ui.cmp.cmp_paymes.ace.handler.AceOrgChangeHandler" >
						<property name="billForm" ref="billForm" />
					</bean>
				</property>
			</bean>
			<!-- nc.ui.pubapp.uif2app.event.billform.AddEvent -->
			<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
				<property name="event" value="nc.ui.pubapp.uif2app.event.billform.AddEvent" />
				<property name="handler">
					<bean class="nc.ui.cmp.cmp_paymes.ace.handler.AceAddHandler" />
				</property>
			</bean>
			<!-- 数据行勾选事件 -->
			<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
				<property name="event" value="nc.ui.pubapp.uif2app.event.list.ListHeadRowStateChangeEvent" />
				<property name="handler">
					<bean class="nc.ui.cmp.cmp_paymes.ace.handler.AceListHeadRowStateChangeHandler" />
				</property>
			</bean>
	
		</list>
	</property>
</bean>

新增事件的实现类,上面xml中handler属性设置的那个nc.ui.cmp.cmp_paymes.ace.handler.AceListHeadRowStateChangeHandler


package nc.ui.cmp.cmp_paymes.ace.handler;

import nc.ui.pubapp.uif2app.event.IAppEventHandler;
import nc.ui.pubapp.uif2app.event.list.ListHeadRowStateChangeEvent;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;

/**
 * 数据行勾选事件 </p>
 * 创建时间: 2020年9月25日 上午11:38:43
 * @author xuzihui
 *
 */
public class AceListHeadRowStateChangeHandler implements IAppEventHandler<ListHeadRowStateChangeEvent> {

	@Override
	public void handleAppEvent(ListHeadRowStateChangeEvent e) {
		
		//获取选中行的单据编码
		Object vbillcode = e.getBillListPanel().getHeadBillModel().getValueAt(e.getRow(), "vbillcode");
		if(vbillcode == null) {
			ExceptionUtils.wrappBusinessException("当前行数据中单据编码为空!");
		}
		
		//获取当前查询出来的数据行数
		int rowCount = e.getBillListPanel().getBillListData().getHeadBillModel().getRowCount();
		for(int i = 0 ; i < rowCount ; i++){
			if(i == e.getRow()) continue;
			String billno = (String) e.getBillListPanel().getHeadBillModel().getValueAt(i, "vbillcode");
			
			//如果有其它单据行的单据编码与当前选中行的单据编码相同,则同样勾选该行数据
			if(vbillcode.equals(billno)){
				e.getBillListPanel().getHeadBillModel().setRowState(i, e.getRowStaus());
			}
		}
	}

}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值