我制作一个弹出窗口。
Window window = (Window)Executions.createComponents("./org.zul", null, **map**);
./ org.zul 有一个 EditController.java 这个控制器如何获得地图? 感谢
答案 0 :(得分:4)
您可以使用它来打开弹出/模态窗口
Map args = new HashMap();
args.put("myMap", thisIsMyMap);
popupWin = (Window)Executions.createComponents("org.zul", null, args);
// popupWin.setClosable(true);
popupWin.doModal();
并在 EditController.java
中thisIsMyMap = (HashMap) Executions.getCurrent().getArg().get("myMap");
答案 1 :(得分:1)
就像这样
Map<String, Object> args = new HashMap<String, Object>();
defaultReorderSelected = new ListModelList<ReorderData>()
args.put("availableList", availableReorderList);
args.put("defaultSelected", defaultReorderSelected);
public void createReorderModal(Component comp, Map args) {
Executions.getCurrent().createComponents("/core/component/model_window_new.zul",
comp, args);
}
在 model_window_new.zul viewModel的afterCompose()
方法中,您必须编写您在Map
@AfterCompose
public void doAfterCompose(@ContextParam(ContextType.VIEW) Component view,
@ExecutionArgParam("availableList") ListModelList<SortData> availableList,
@ExecutionArgParam("defaultSelected") ListModelList<SortData> defaultSelectedList){
//Your Business Logic.
}