nc65 卡片刷新数据

1.效果说明:点击确认或者取消确认后刷新选中数据,不失去鼠标焦点

2.找到该节点对应的xml,加入如下的配置,

<bean id="bmModel" class="nc.ui.pubapp.uif2app.model.BillManageModel">
		<property name="context"><ref bean="context"/></property>
		<property name="businessObjectAdapterFactory"><ref bean="BOAdapterFactory"/></property>
	</bean>
<!-- 卡片下刷新 -->
	<bean id="cardRefreshAction" class="nc.ui.pubapp.uif2app.actions.RefreshSingleAction">
		<property name="model" ref="bmModel" />
	</bean>
<!-- 确认按钮-->
	<bean id="comfirmAction" class="nc.ui.fc_ese.cs.compresult.ace.action.ComfirmAction" >
	    <property name="model" ref="bmModel" />
	    <property name="editor"><ref bean="billForm"/></property>
	    <property name="service" ref="bmModelModelService" />
	    <property name="refreshAction"><ref bean="cardRefreshAction"/></property>
	</bean>

3.找到按钮对应的类,将nc.ui.pubapp.uif2app.actions.RefreshSingleAction类注入该按钮对应的action中,添加get和set方法,在doAction方法中调用相应的getRefreshAction().doAction(e)API即可。

@Override
	public void doAction(ActionEvent e) throws Exception {

		if (UIDialog.ID_YES == CommonConfirmDialogUtils
				.showConfirmEnableDialog(getModel().getContext()
						.getEntranceUI())) {

			ICompResultVoucher iCompResultVoucher = NCLocator.getInstance()
					.lookup(ICompResultVoucher.class);

			iCompResultVoucher.createVoucher((CompResultAggVO) getModel()
					.getSelectedData());

			getModel().directlyUpdate(getModel().getSelectedData());
			getRefreshAction().doAction(e);
			ShowStatusBarMsgUtil.showStatusBarMsg("确认成功", getModel()
					.getContext());

		}
	}

4.如果要刷新整个列表则在对应的xml中配置如下的刷新类并注入到相应的按钮中调用相应的方法即可。

<!--======= 动作:[newActions] [刷新] ===========-->
	<bean id="defaultRefreshAction" class="nc.ui.pubapp.uif2app.query2.action.DefaultRefreshAction">
		<property name="model"><ref bean="bmModel"/></property>
		<property name="dataManager"><ref bean="bmModelModelDataManager"/></property>
		<property name="exceptionHandler"><ref bean="exceptionHandler" /></property>
	</bean>



猜你喜欢

转载自blog.csdn.net/u014714841/article/details/80620156