1

我制作了一个弹出窗口。

Window window = (Window)Executions.createComponents("./org.zul", null, **map**);

./org.zul有一个EditController.java这个控制器如何获取地图?谢谢

4

2 回答 2

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");
于 2013-08-29T15:34:13.230 回答
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.zulafterCompose() viewModel 的方法中,您必须编写与 Key of 中使用的名称相同的名称Map

    @AfterCompose
    public void doAfterCompose(@ContextParam(ContextType.VIEW) Component view,
    @ExecutionArgParam("availableList") ListModelList<SortData> availableList,
                @ExecutionArgParam("defaultSelected") ListModelList<SortData> defaultSelectedList){
//Your Business Logic.
}
于 2013-08-29T12:31:58.543 回答