Primefaces Datatable-Caluclate age by using DateofBirth
By using DateofBirth attribute of an employee. I have to display it in
primefaces Datatable. I tried like this.
<p:column headerText="Age" style="text-align: center !important;">
<h:outputText
value="#{appointmentsBean.getAge('app.mtmdtreatment.dateOfBirth')}"></h:outputText>
</p:column>
Bean.
public int getAge(Date date) {
//code for getting today age.
}
But there is an EL exception saying that cannot convert Date to String
How can I approach this?
No comments:
Post a Comment