1
我想请教一下在列表框中从多个选择中获得价值,我已经在ZUL代码:充分利用多选择在列表框中ZK值
<n:tr>
<n:td>
<label value="Privilege"/>
</n:td>
<n:td>
<label value=""/>
</n:td>
<n:td>
<listbox id="designations" model="@{addUser$composer.lstPrivilege}" selectedItem="@{selectedUserAcc, converter=com.nsia.doku.escrow.converter.SelectedItemConverter}" multiple="true" checkmark="true" width="200px">
<listitem self="@{each=lstPrivilege}" >
<listcell label="@{lstPrivilege.description}"/>
</listitem>
</listbox>
</n:td>
</n:tr>
<n:tr>
<n:td>
</n:td>
<n:td>
</n:td>
<n:td>
<button label="Submit" onClick='
import com.dokuescrow.dto.Activity;
ArrayList al = new ArrayList();
for (Activity li : selectedUserAcc)
{
al.add(li.activityId);
}
alert(al);
'/>
</n:td>
</n:tr>
我的问题是,我如何得到选择的值在我的控制器类中,我测试我的按钮使用onClick='..
,值selectedUserAcc不为空,就像我想要的,如果我在我的控制器类(例如使用方法)传递动作,我打印出的值为null ..任何人想帮助我,我的班级出了什么问题?
我在控制器的方法是这样的:
public void onClick$submit(Event event){
try {
ArrayList al = new ArrayList();
for (Activity li : selectedUserAcc)
{
al.add(li.getActivityId());
}
alert(al.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
希望有人能帮助me..thanks ..:d