Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Coverting issue from type of java.util.Calendar to integer value

 
Sam Saha
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Input text field which I am mapping to an element of type java.util.Calendar. But I wanted to display value as a number. I am new in JSF and don't know to convert the Calendar value to a number value. I would appreciate if someone can help me to convert this successfully. Thank you very much.

Here is my code:
JSP Code:




Code from Bean:
 
Pradeep Katipamula
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am not sure of you exact requirement, but if its possible to use Date instead of Calender.
You can use 'convertDateTime'. Here is a sample usage



Instead, if you really want to convert the text to a custom type you can go through the below url.

Custom Convertors

hope this helps

Pradeep
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!