Nasir Abbas
Nasir Abbas

Reputation: 86

How to update model on change / date select of p:calendar

<h:form id="frm">
   <p:calendar id="date" value="#{Test.txtDate}" />
</h:form>
@Named("Test")
@SessionScoped

public class Test implements Serializable {
    private Date txtDate;

    public Date getTxtDate() {
        return txtDate;
    }

    public void setTxtDate(Date txtDate) {
        this.txtDate = txtDate;
        System.out.println("Date: " + txtDate);
    }

    public Test () {

    }
}

setter does not run when value is selected, i need as value is changed, the setter should be fired.

Upvotes: 0

Views: 38

Answers (0)

Related Questions