F7已选列表控件的使用
1、进入页面后,控件选择单据列表和F7已选列表
![image.webp](/download/01009698952c803a4a5dbf1cf2e97bdd6179.webp)
2、处理页面布局和列表展示
![image.webp](/download/01007924ff93617942cb99689a20a704a869.webp)
3、添加事件处理插件
public class F7SelectListPlugin extends AbstractListPlugin {
private static final Log logger = LogFactory.getLog(F7SelectListPlugin.class);
private static final String BILLLISTAP = "billlistap";
private static final String SELECTED_SOLUTION = "f7selectedlistap";
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
// 配置列表与F7已选列表互动增删监听
BillList billList = this.getControl(BILLLISTAP);
F7SelectedList f7SelectedList = getControl(SELECTED_SOLUTION);
billList.addListRowClickListener(new ListRowClickListener() {
public void listRowDoubleClick(ListRowClickEvent arg0) {
throw new UnsupportedOperationException();
}
public void listRowClick(ListRowClickEvent listRowClickEvent) {
BillList source = (BillList) listRowClickEvent.getSource();
f7SelectedList.addItems(getF7SelectedItems(source.getSelectedRows()));
}
});
billList.addListRowSelectAllListeners((event) -> {
BillList source = (BillList)event.getSource();
f7SelectedList.addItems(getF7SelectedItems(source.getSelectedRows()));
});
billList.addClearSelectionListener((event) -> {
f7SelectedList.addItems(new ArrayList<>(0));
});
f7SelectedList.addF7SelectedListRemoveListener((f7SelectedListRemoveEvent) -> {
billList.restoreSelection(f7SelectedListRemoveEvent.getParam().toString());
});
f7SelectedList.addF7SelectedListRemoveAllListener((f7SelectedListRemoveEvent) -> {
billList.clearSelection();
});
}
/**
* 将列表选择选项转化成F7内容项
*/
private List<ValueTextItem> getF7SelectedItems(ListSelectedRowCollection selectedRows) {
ArrayList<ValueTextItem> valueTextItems = new ArrayList<>();
for (ListSelectedRow row : selectedRows) {
valueTextItems.add(new ValueTextItem(row.toString(), row.getBillNo()));
}
return valueTextItems;
}
}
4、成果展示
![image.webp](/download/01004494579ac45e41f482b5fd84b43b806f.webp)
F7已选列表控件的使用
1、进入页面后,控件选择单据列表和F7已选列表![image.webp](/download/01009698952c803a4a5dbf1cf2e97bdd6179.webp)2、处理页面布局和列表...
点击下载文档
本文2024-09-16 17:46:34发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-17858.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章