• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Rich Calendar Fetch Records onDateselected

 
Asim Shaikh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello < I am stuck in situation where I want a calendar which will fire event ondateselect or ondate change It will search table records and display records as selected date
while I am using h:inputText for the same it is working fine I want it to take Date as input from calendar


<------------------Jsp------------------------------------------>

<rich:calendar value="#{eventMaster.eventDate}"

popup="#{eventMaster.popup}" datePattern="#{eventMaster.pattern}"

showApplyButton="#{eventMaster.showApply}" cellWidth="24px" cellHeight="22px" style="width:200px"

disabled="#{eventMaster.disabled or eventMaster.viewMode}"

ondateselect="eventMaster.searchOutputScreenRecords">

</rich:calendar>



<-----Bean----->

public Date getEventDate() {

return eventDate;

}

public void setEventDate(Date eventDate) {

this.eventDate = eventDate;

}


<-----action ----->

public String searchOutputScreenRecords() {

try {

this.searchVariableAvailable = true;

EventMasterOps opsObj = new EventMasterOps();

if (this.outputSearch != null) {

this.outputList = opsObj.searchRecordsInDatabase(this.outputSearch, ConstantsUtility.searchOutputForm);

if (this.outputList == null) {

this.massage = "No Search Record is found.";

}

}


} catch (Exception e) {


log.info("exception in EventMaster:searchOutputScreenRecords()::" + e.getMessage());

}

return "outputClient";

}


<-----Operation file from where I am calling query---------------->


public List<EventMasterBean> searchRecordsInDatabase(String searchValue, String formType) {

FindDescriptionHelper fdHelp = new FindDescriptionHelper();

PreparedStatement pstmt = null;

ResultSet rs = null;

try {

this.eventmaster = new ArrayList<EventMasterBean>();

SqlSearchQuriesUtil searchqueryUtil = new SqlSearchQuriesUtil();

String query = "";


if (formType.equals(ConstantsUtility.searchInputForm)) {


query = searchqueryUtil.getEventSearchInputQuery(searchValue);




}
 
Tim Holloway
Bartender
Posts: 18417
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Asim!

We have a "Code" button on our message editor that can insert tags for pre-formatted text (java code, XML and so forth). It will keep your examples from being re-formatted.

I assume you want an action to take place when someone clicks on a Calendar date. RichFaces can do that with AJAX. There should be an example in the RichFaces manual, as it's a common thing to do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!