リストボックスの複数選択から値を取得することについて質問したいのですが、zul には次のようなコードがあります。
<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='..
。コントローラークラスでアクションを渡す場合(例:メソッドを使用)、私が出力した値は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();
}
}
誰かが私を助けてくれることを願っています..ありがとう..:D