我正在學習Seam幾天以來,我想創建簡單的過濾器使用 <h:selectManyCheckbox>
和<f:selectItems>
標籤。 這裏是標籤斷枝XHTML文件:如何正確使用<h:selectManyCheckbox>和<f:selectItems>與條件
<h:selectManyCheckbox value="#{userSessionsSession.selected}">
<f:selectItems value="#{usersSessionsPage.logLevelList}" />
</h:selectManyCheckbox>
中UserSessionSession我:
private List<String> selected;
public List<String> getSelected() {
return selected;
}
public void setSelected(List<String> selected) {
this.selected = selected;
}
UserSessionPage:
private List<SelectItem> logLevelList;
public List<SelectItem> getLogLevelList(){
if(logLevelList == null){
logLevelList = new ArrayList<SelectItem>();
Collection<MdoUserSessionDetStatus> tmpList = sessionAuditUtils.getDetailsStatusEntities();
for(MdoUserSessionDetStatus mdo: tmpList){
logLevelList.add(new SelectItem(mdo.getCode(), mdo.getName()));
}
}
return logLevelList;
}
,並在功能上與標準restictions:
if (selected != null && !ANY_STATUS.equals(selected)) {
criteria.add(Restrictions.eq("mdoUserSessionDetStatus.code", selected));
}
當我檢查和提交選項沒有任何反應和控制檯dispalys警告:
WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=filterPanelForm:j_id163[severity=(ERROR 2), summary=(Conversion Error setting value 'DEBUG' for '#{userSessionsSession.selected}'.), detail=(Conversion Error setting value 'DEBUG' for '#{userSessionsSession.selected}'.)]
我不知道如何正確處理這個事件,任何一個能幫助我嗎? 我將不勝感激。
嘗試添加' '這將顯示頁面上的錯誤,你不會有警告 –
Daniel