1.给卡片设置必填项:如下图所示,在单据模板初始化节点,选中需要设置的字段名称然后在对应的显示属性中勾选是否必输项即可
2.设置必输项后只是前段页面显示为必须输入,但是还是可以空值保存的,所以要对必输项进行非空校验
找到对应节点的xml文件,然后按如下配置:
<bean id="cancelAction" class="nc.ui.pubapp.uif2app.actions.CancelAction">
<property name="model"><ref bean="bmModel"/></property>
<property name="editor"><ref bean="billForm"/></property>
<property name="exceptionHandler"><ref bean="exceptionHandler" /></property>
</bean>
<!-- 保存组合校验 -->
<bean id="validateService" class="nc.ui.pubapp.uif2app.validation.CompositeValidation">
<property name="validators">
<list>
<bean class="nc.ui.pubapp.uif2app.validation.TemplateNotNullValidation">
<property name="billForm" ref="billForm" />
</bean>
</list>
</property>
</bean>
<!--分隔按钮-->
<bean id="separatorAction" class="nc.funcnode.ui.action.SeparatorAction" />
<bean id="exceptionHandler" class="nc.ui.uif2.DefaultExceptionHanler">
<constructor-arg><ref bean="container"/></constructor-arg>
<property name="context"><ref bean="context" /></property>
</bean>
3.然后重新打开节点进行验证即可。