设置单据体页签可用状态

getBillCardPanel().setTabEnabled(IBillItem.BODY, IWaGradeCommonDef.WA_SECLV, true);

获取表体按钮

BillListPanel.getBodyTabbedPane().getToolBarActions()

按钮Action中设置按钮的可用状态,重写isActionEnable方法

@Override
protected boolean isActionEnable() {

return this.getModel().getAppUiState() == AppUiState.NOT_EDIT;

}

//同时需要将按钮加入model事件监听
public void setModel(BillManageModel model) {
this.model = model;
this.model.addAppEventListener(this);
}

如何获取功能节点号

getModel().getContext().getNodeCode()

单据卡片/列表状态表格是否可多选

列表 void nc.ui.pub.bill.BillListPanel.setParentMultiSelect(boolean bMultiSelect)

卡片 void nc.ui.pub.bill.BillCardPanel.setBodyMultiSelect(boolean bMultiSelect)

列表增加复选框

<bean id="listView" class="nc.ui.pubapp.uif2app.view.ShowUpableBillListView" init-method="initUI">
<property name="paginationBar" ref="paginationBar" />
<property name="model" ref="manageAppModel"></property>
<property name="templateContainer" ref="templateContainer"> </property>
<!-- 0鼠标多选,1复选框 -->
<property name="multiSelectionMode" value="1"></property>
</bean>

底部显示异常消息

ShowStatusBarMsgUtil.showErrorMsgWithClear(“提示”, “中间表无数据!”, this.getModel().getContext());

状态栏正常消息

ShowStatusBarMsgUtil.showStatusBarMsg(“没有选择任何数据”, this.getModel().getContext());

触发前台按钮Action的方法

AddLineAction action=(AddLineAction)e.getBillCardPanel().getActionMap().get(“增行”);

action.doAction();

调用模板中的非空字段的必输验证

getBillCardPanelWrapper().getBillCardPanel().dataNotNullValidate();

界面支持Shift+Alt自动填充功能

需要初始化UI代码中调用enableFillableItems方法

String[] enableItems =
new String[] {
PraybillItemVO.DREQDATE, PraybillItemVO.DSUGGESTDATE,
PraybillItemVO.CORDERTRANTYPECODE, PraybillItemVO.CPROJECTID,
PraybillItemVO.PK_REQDEPT_V, PraybillItemVO.VBMEMO,
PraybillItemVO.VBDEF1, PraybillItemVO.PK_EMPLOYEE//gwj add 采购员字段支持填充
};
BillCardPanelUtils cardUtils =
new BillCardPanelUtils(this.getBillCardPanel());
// 放开字段的批改
cardUtils.enableItemsFill(enableItems);

赋值之后界面上显示的是PK

this.editor.getBillCardPanel().getBillModel().loadLoadRelationItemValue();

获取界面上业务单元控件的值,获取org panel的值

ShowUpableBillForm billForm = (ShowUpableBillForm) cardPanel.getParent();
UIRefPane org_refPane = (UIRefPane) billForm.getBillOrgPanel().getComponent(1);
String pk_org = org_refPane.getRefModel().getPkValue();

列表界面刷新

<!-- 列表下刷新 -->
<bean id="refreshAction" class="nc.ui.tmpub.action.query.DefaultRefreshAction">
<property name="dataManager" ref="modelDataManager" />
<property name="model" ref="manageAppModel" />
</bean>

卡片界面刷新

<!-- 卡片下刷新 -->
<bean id="cardRefreshAction" class="nc.ui.pubapp.uif2app.actions.RefreshSingleAction">
<property name="model" ref="manageAppModel" />
</bean>

界面数据刷新

this.getDataManager().refresh();

获取icon的图标位置的方法

ThemeResourceCenter.getInstance().getImage("themeres/ui/toolbaricons/worktable.png")
//或者
private Icon icon = ClientToolKit
.loadImageIcon("/themeroot/blue/themeres/ui/toolbaricons/realign.png");

UI前端界面上重排行号的工具类

BillRowNoUtils.addLineRowNos(this.getEditor().getBillCardPanel(),"crowno", len);