0
我有這樣的代碼在ZK:的SelectItem列表框
<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。
然後我們的想法是:
我有一個用戶列表的頁面,我需要加載一個頁面,在該頁面中,我需要加載一個列表,用戶MNO用戶已關聯。
但我的列表框永遠不會加載我的收藏與我選擇的項目。而且我不知道,什麼發生=(
有人可以幫我嗎?
不,如果我加我有一個錯誤 – user2768380
,我不知道爲什麼 – user2768380
什麼是錯誤信息?可能你必須使用集合<>'的'Set <>'insted。 – bidifx