} catch (CreateException e) {
logger.error("[execute] Exception thrown.", e);
throw new ServletException(e);
}
valueList.setDataSource(dataSource);
ValueListVO listObject = valueList.getValueList(individualId, listParameters);
ArrayList buttonList = new ArrayList();
ValueListDisplay displayParameters = null;
if (actionType != null && actionType.startsWith("lookup")) {
String itemType = "Item";
if(actionType != null && actionType.equals("lookupSubItem")){
itemType = "SubItem";
}
buttonList.add(new Button("Select", "select", "lu_selectList('"+itemType+"');", false));
StringBuffer parameterValues = new StringBuffer();
if (itemid != 0) {
if(actionType != null && actionType.equals("lookup")){
AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
int parentItemID = 0;
try {
AccountFacade remote =(AccountFacade)accountFacadeHome.create();
remote.setDataSource(dataSource);
parentItemID = remote.getParentItemID(itemid);
} catch (CreateException e) {
logger.error("[execute] Exception thrown.", e);
throw new ServletException(e);
}
buttonList.add(new Button("Back", "back", "lu_backList('Item'," + parentItemID + ",'" + presentID + "');", false));
}
parameterValues.append(ValueListConstants.AMP);
parameterValues.append("itemid=" + itemid);
}
/*
if(presentID != null && presentID.length() != 0){
String presentIDParamValue = ValueListConstants.AMP + "presentID=" + presentID;
parameterValues.append(presentIDParamValue);
listObject.setCurrentLinkParameters(presentIDParamValue);
}
*/
listObject.setCurrentPageParameters(parameterValues.toString());
displayParameters = new ValueListDisplay(buttonList, false, false);
displayParameters.setRadio(true);
listObject.setLookup(true);
listObject.setLookupType(actionType);
if(actionType != null && actionType.equals("lookupSubItem")){
request.setAttribute("dynamicTitle", "Sub-Item");
request.setAttribute("lookupType", "Sub-Item");
}
else{
displayParameters.setRadioToCheckBox(true);
request.setAttribute("dynamicTitle", "Item");
request.setAttribute("lookupType", "Item");
}
request.setAttribute("hideMarketingList", new Boolean(true));
} else {
buttonList.add(new Button("Delete", "delete", "vl_deleteList();", false));
buttonList.add(new Button("Duplicate", "duplicate", "vl_duplicateList();", false));
displayParameters = new ValueListDisplay(buttonList, true, true);
}
displayParameters.setSortable(true);
displayParameters.setPagingBar(true);
displayParameters.setLink(true);
listObject.setDisplay(displayParameters);
// Stick the list on the request and then the custom list tag will handle
// it.
if (logger.isDebugEnabled()) {
long debugTime = (System.currentTimeMillis() - start);
logger.debug("[execute] End to End: " + debugTime + " ms");
listObject.getParameters().setDebugTime(debugTime);
}
request.setAttribute("valueList", listObject);
// For the searchBar
String moduleID = (String)moduleList.get("Item");
request.setAttribute("moduleId", moduleID);