Thursday, 18 August 2016

ADF : ViewCritiria – Date – search within 7 days records.



ADF : ViewCritiria – Date – search within 7 days records.

 


 

ViewObjectImpl vo = <<get VO instance>>
        calendar.setTime(new Date()); // Now use today date.
        calendar.add(Calendar.DATE, -7); // go back 7 days
        Date selectedDate = calendar.getTime();
        java.sql.Date sqlDate = new java.sql.Date(selectedDate.getTime());
        vc = vo.getViewCriteria("BatchesWithInSelectedDateVC");
        vo.setNamedWhereClauseParam("batchSelectionDate", sqlDate);
        vo.applyViewCriteria(vc,true);
        vo.executeQuery();
        count = vo.getEstimatedRowCount();
        fileImportTabDetailBean.setActiveTab_7DaysRecs(count);
        vo.removeApplyViewCriteriaName("BatchesWithInSelectedDateVC");
 

No comments:

Post a Comment