DisplayList displaylistSession = ( DisplayList )session.getAttribute( "displaylist") ;
DisplayList displaylist = ( DisplayList )request.getAttribute( "displaylist") ;
EntityList DL = new EntityList();
ListGenerator lg = ListGenerator.getListGenerator(dataSource);
if( displaylist == null )
{
String searchString = "ADVANCE:SELECT entityid FROM vendor ";
DL = ( EntityList )lg.getEntityList( userobjectd.getIndividualID(), 1,listpreference.getRecordsPerPage() , searchString ,listpreference.getSortElement());
if (DL == null)
{
DL = new EntityList();
}
DisplayList DL1 = lg.getDisplayList(DL.getListID() );
DL1.setListType("Vendor");
DL.setListType("Vendor");
DL.setPrimaryTable("vendor");
DL1.setTotalNoOfRecords(DL.size());
DL.setTotalNoOfRecords(DL.size());
}
else
{
String searchSession = displaylistSession.getSearchString();
String searchrequest = displaylist.getSearchString();
if(searchSession == null)
searchSession = "";
if(searchrequest == null)
searchrequest = "";
if (( (displaylistSession.getListID() == displaylist.getListID() ) &&
( displaylist.getDirtyFlag() == false ) &&
( displaylist.getStartAT() >= displaylistSession.getBeginIndex() ) &&
( displaylist.getEndAT()<=displaylistSession.getEndIndex() ) &&
(displaylist.getSortMember().equals(displaylistSession.getSortMember()) &&
(displaylist.getSortType()==(displaylistSession.getSortType())) &&
(searchSession.equals(searchrequest)) )) ||
displaylist.getAdvanceSearchFlag() == true)
{
DL = (EntityList)displaylistSession;
DL.setListType("Vendor");
DL.setPrimaryTable("vendor");
DL.setTotalNoOfRecords(DL.size());
request.setAttribute("displaylist" , displaylistSession );
}
else
{
DL = ( EntityList )lg.getEntityList( displaylist );
DisplayList DL1 = lg.getDisplayList(DL.getListID() );
DL1.setListType("Vendor");
DL.setListType("Vendor");
DL.setPrimaryTable("vendor");
DL1.setTotalNoOfRecords(DL.size());
DL.setTotalNoOfRecords(DL.size());