• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in populating LIST of applications in JSF and . Do please suggest

 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing a problem in using JSF. I have one LIST method that is populated with list of applications.Below is the code for this.

private List capitalImprProjects;
private void loadSelectItems() throws ASMException{
try {

Map map= FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
Facility facility = (Facility) map.get("facility");
//facility = FacilityTrans.getInstance().getFacilityDetails(facility);
map.put("facility",facility);
capitalImprProjects = CipTrans.getInstance().getFullCipList(facility);
//map.put("capitalImprProjects",capitalImprProjects);

} catch (ASMException asex) {
System.out.println(" ASMException " + asex.getMessage());
}
}

public List getCapitalImprProjects() throws ASMException{
loadSelectItems();
return capitalImprProjects;
}


public List getFullCipList(Facility facility) throws ASMException {
try {
Session session = HibernateUtil.getInstance().getSession();
fullCipList = (ArrayList) session.createQuery(
" from CapitalImproveProj C where C.facility.facilityId=:facilityId order by C.cipId").setInteger("facilityId", facilityId).list();

System.out.println("Array List Size" + fullCipList.size());

} catch (Exception asmex) {
System.out.println("### Exception getFullCipList( "
+ asmex.getMessage());
throw new ASMException(ASMConstants.EXCP_TRANS_ERROR,
ASMConstants.FORM_LOGIN_USERNAME);
}

return fullCipList;
}


The problem is , I am using datatable to print the entire list of applications with applicationId and applicationName. I made applicationId as URL , where on clicking this the corresponding application opens up. Instead of this, it is calling the LIST method again and is populating my list of applications again.

Any suggestions where I am going wrong.
 
Sushma Sharma
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your JSP code where you are displaying the list. Also, post the action method which you are calling from the commandLink.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!