DateSelectEvent Is not recognised I am using Primefaces 4.0 with maven

I want to render weekEndingDate as saturday Date according to selected EmployeeJoing date but I am getting issue in DateSelectEvent

<p:outputLabel value="Employee Joining Date:MM/dd/yyyy" />
                <p:calendar value="#{employeeBean.employeeJoiningDate}"

                    id="ejoinDate" required="true" label="Employee 
Joining   Date">
                    <p:ajax event="dateSelect"  
update="weekEndingDate" listener="#{employeeBean.dateChange}"></p:ajax>
                    </p:calendar>
            <p:outputLabel value="Week ending Date" />
                <p:calendar value="#{employeeBean.weekEndingDate}"
                    id="weekEndingDate">
                <f:convertDateTime pattern="MM/dd/yyyy"    type="date"   />
                </p:calendar>

Here I am using inside Bean this method

        public void dateChange(DateSelectEvent event) {
            System.out.println("doing well in office");
            Date date = event.getDate();
            System.out.println("File Date: " + date);
            System.out.println("Hello... I am in DateChange");
        }

Answers


If you are using newer version primefaces 3.5 or 4 then this event has been deprecated. Use this code instead.

public void onDateSelect(SelectEvent selectEvent) {
    Date date = (Date) selectEvent.getObject();
    event = new DefaultScheduleEvent("onDateSelect", date, date);
}

Also you can check the following link http://forum.primefaces.org/viewtopic.php?f=3&t=27590

Update ::

ajax code no change the event will remain as dateSelect do not change to select

<p:ajax event="dateSelect"  update="weekEndingDate" listener="#{employeeBean.dateChange}" />

public void dateChange(SelectEvent event) {
        System.out.println("doing well in office");
        Date date = (Date)event.getObject();}

should work fine. It is working fine in my application.

Here is another link for you to check http://www.primefaces.org/showcase-labs/ui/calendarAjax.jsf


Another solution found as just for the knowledge that, if we process something except @this then also we can't get bean method,

public void dateChange(SelectEvent event){}

Need Your Help

How to give arguments to kill via pipe

linux bash shell command-line command-line-arguments

I need to search for a certain process and kill that process. I wrote a command like this:

VBA "If...Then" for keyword found in HTMLtag Innertext

html excel vba excel-vba innertext

Is it possible to write an If...Then command to reference a keyword/phrase in part of an HTML's innertext.