F7设置过滤

1. 对分录F7字段设置数据过滤

<span style="font-family:Microsoft YaHei;">public void onLoad() throws Exception {
    final KDBizPromptBox kdtCT_owner_PromptBox = new KDBizPromptBox();
    kdtCT_owner_PromptBox.setQueryInfo("com.kingdee.eas.basedata.org.app.SaleOrgUnitQuery");
    kdtCT_owner_PromptBox.setVisible(true);
    kdtCT_owner_PromptBox.setEditable(true);
    kdtCT_owner_PromptBox.setDisplayFormat("$number$");
    kdtCT_owner_PromptBox.setEditFormat("$number$");
    kdtCT_owner_PromptBox.setCommitFormat("$number$");

    EntityViewInfo eviOwner = new EntityViewInfo();  //过滤设置
    FilterInfo fiOwner = new FilterInfo();
    fiOwner.getFilterItems().add(new FilterItemInfo("isBizUnit", Boolean.TRUE)); //实体字段名称
    eviOwner.setFilter(fiOwner);
    kdtCT_owner_PromptBox.setEntityViewInfo(eviOwner); 

    KDTDefaultCellEditor kdtCT_owner_CellEditor = new KDTDefaultCellEditor(kdtCT_owner_PromptBox);
    this.kdtCT.getColumn("owner").setEditor(kdtCT_owner_CellEditor);
    ObjectValueRender kdtCT_owner_OVR = new ObjectValueRender();
    kdtCT_owner_OVR.setFormat(new BizDataFormat("$name$"));
    this.kdtCT.getColumn("owner").setRenderer(kdtCT_owner_OVR);
}</span>

2. F7字段没有对应的 bizunit 界面设置数据过滤

<span style="font-family:Microsoft YaHei;">public void onLoad() throws Exception {
    super.onLoad();

    final KDBizPromptBox kdtEntrys_attachID_PromptBox = new KDBizPromptBox(); //分录字段名称 -- 标准
    kdtEntrys_attachID_PromptBox.setQueryInfo("com.kingdee.eas.fdc.basedata.app.AttachmentQuery");
    kdtEntrys_attachID_PromptBox.setVisible(true);
    kdtEntrys_attachID_PromptBox.setEditable(true);
    kdtEntrys_attachID_PromptBox.setDisplayFormat("$attachID$");
    kdtEntrys_attachID_PromptBox.setEditFormat("$attachID$");
    kdtEntrys_attachID_PromptBox.setCommitFormat("$attachID$");
    KDTDefaultCellEditor kdtEntrys_attachID_CellEditor = new KDTDefaultCellEditor(kdtEntrys_attachID_PromptBox);
    this.kdtEntrys.getColumn("attachID").setEditor(kdtEntrys_attachID_CellEditor);
    ObjectValueRender kdtEntrys_attachID_OVR = new ObjectValueRender();
    kdtEntrys_attachID_OVR.setFormat(new BizDataFormat("$attachID$"));
    this.kdtEntrys.getColumn("attachID").setRenderer(kdtEntrys_attachID_OVR);

    kdtEntrys_detailPanel.setTitle("合同列表");
    kdtEntrys.getColumn("attachName").getStyleAttributes().setLocked(true);  //分录关联字段不可编辑设置
    kdtEntrys.getColumn("attachType").getStyleAttributes().setLocked(true);
}

public void kdtEntrys_Changed(int rowIndex, int colIndex) throws Exception {//在对应的值改变事件中对关联字段赋值
    super.kdtEntrys_Changed(rowIndex, colIndex);
    if ("attachID".equalsIgnoreCase(kdtEntrys.getColumn(colIndex).getKey())){  //改变的是指定的设置的 F7 
        Object attachIDVal = kdtEntrys.getCell(rowIndex, "attachID").getValue(); 
        if (attachIDVal != null) {
            AttachmentCollection attachmentCol = AttachmentFactory.getRemoteInstance().getAttachmentCollection(
                " where name = '" + attachIDVal.toString() + "'"); //主要是防止多条数据
            if (attachmentCol.size() > 0){
                AttachmentInfo attachmentInfo = attachmentCol.get(0);
                kdtEntrys.getCell(rowIndex, "attachID").setValue(attachmentInfo.getAttachID());//分录界面是文本框,值改变事件之后需充值
                kdtEntrys.getCell(rowIndex, "attachType").setValue(attachmentInfo.getType());                
                kdtEntrys.getCell(rowIndex, "attachName").setValue(attachmentInfo.getName());
            }
	}
    }
}</span>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值