if (log.isDebugEnabled()) {
log.debug("selectedStatus is " + selectedStatus);
}
String statusType = selectedStatus;
ListBoxBean statusTypeBean = event.getListBoxBean("statusTypeBean");
if ( statusTypeBean != null ) {
String newStatusType = statusTypeBean.getSelectedValue();
if ( newStatusType != null ) {
session.setAttribute(SELECTED_STATUS, newStatusType);
statusType = newStatusType;
}
}
if (log.isDebugEnabled()) {
log.debug("about to call getAccountRequestsByStatus, statusType is "
+ statusType);
}
List requests = accountService.getAccountRequestsByStatus(statusType);
setOrderedOids(requests);
statusTypeBean.clear();
statusTypeBean.setMultipleSelection(false);
ListBoxItemBean itemAll = new ListBoxItemBean();
itemAll.setName("ALL");
itemAll.setValue("ALL");
itemAll.setSelected("ALL".equals(statusType));
statusTypeBean.addBean(itemAll);
EnumSet allStatus = EnumSet.allOf(AccountRequest.Status.class);
for (Iterator itr = allStatus.iterator(); itr.hasNext(); ) {
AccountRequest.Status status = (AccountRequest.Status)itr.next();
String name = status.toString();
ListBoxItemBean item = new ListBoxItemBean();
item.setName(name);
item.setValue(name);
item.setSelected(name.equals(statusType));
statusTypeBean.addBean(item);
}
req.setAttribute("requests", requests);
setNextState(req, LIST_REQUEST_JSP);