ZK に次のコードがあります。
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="CreateList" border="normal" mode="modal" width="320px"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('UserMno')">
<label value="First Name"></label>
<listbox model="@bind(vm.allMno)" checkmark="true" multiple="true" selectedItem="@bind(vm.mnoList)"/>
<button id="closeBtn" hflex="1" label="close" onClick="CreateList.detach()" />
</window>
</zk>
そして、アイデアは、ユーザーのリストがあり、ユーザーをクリックするとMnoのコレクションがあり、新しいページを開くと、すべてのMnoをリストボックスにロードする必要がありますが、ユーザーのmnoはチェックする
そして、私はJavaでviewModelを持つクラスを持っています。
public class UserMno {
Collection<String> mnoList;
Collection<String> allMno = MnoDAO.getAllMnosByName();
public Collection<String> getMnoList() {
return mnoList;
}
public void setMnoList(Collection<String> mnoList) {
this.mnoList = mnoList;
}
public Collection<String> getAllMno() {
return allMno;
}
public void setAllMno(Collection<String> allMno) {
this.allMno = allMno;
}
@AfterCompose
public void initSetup(@ExecutionArgParam("mnoList") Collection<String> mnoList) {
this.mnoList=mnoList;
}
}
そして、私がユーザーを渡すJavaは次のとおりです。
@Command
public void showModal(@BindingParam("languageContributionStatus") UserStatus mnoList) {
//create a window programmatically and use it as a modal dialog.
final HashMap<String, Object> map = new HashMap<String, Object>();
setPickedItemSet(mnoList.getMnoList());
map.put("mnoList", mnoList.getMnoList());
win = (Window) Executions.createComponents("/com.users/CreateMnosUser.zul", null, map);
win.doModal();
}
UserStatus は Mno のコレクションを持つクラスであり、ユーザーを選択すると、私のユーザーは mnoList になります。
次に、アイデアは次のとおりです。
ページにユーザーのリストがあり、ページをロードする必要があり、そのページで、ユーザーが関連付けたユーザー名のリストをロードする必要があります。
しかし、私のリストボックスは、選択したアイテムでコレクションをロードしません。そして、私は知りません、何が起こるか =(.
誰か助けてくれませんか?