Reputation: 297
I got a problem when using rich:calendar
: after selecting the value, I am setting the value in the bean of type Calendar. In the bean it is showing an error and the date value is appeared along with the time so how can we get only date value without getting the time
Here is the code I have written:
<rich:calendar value="#{editCustomerBean.person.demographic.dateOfBirth}"
cellWidth="15px" cellHeight="22px" style="width:200px"
datePattern="yyyy,dd,MM"/>
The error message says:
SEVERE: //C:/Workspace/Kumar/WebContent/satish/Main.xhtml @71,268
value="#{editCustomerBean.person.demographic.dateOfBirth}":
Can't set property 'dateOfBirth' on
class 'com.customer.types.Information' to value '7/11/12
12:00 AM'.
When I set the value 2012,11,07 in the main page, I get the value '7/11/12
with an extra
12:00 AM'12:00 AM
.
How can I get only the date value?
Upvotes: 0
Views: 637
Reputation: 23806
The message you are seeing with the value '7/11/12 12:00 AM' is not wrong, it is just the result of the .toString()
method of the object date create by rich:calendar
.
You should check if the class com.customer.types.Information
(which from the message, it seems that is the type of the editCustomerBean.person.demographic
property) actually has the appropriate setDateOfBirth(Date dt)
method. Then, fix your code accordingly (pointing to the proper property or creating the adequate setter).
Upvotes: 1