The moose likes JSF and the fly likes Coverting issue from type of java.util.Calendar to integer value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Coverting issue from type of java.util.Calendar to integer value" Watch "Coverting issue from type of java.util.Calendar to integer value" New topic
Author

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

Sam Saha
Ranch Hand

Joined: Jan 23, 2010
Posts: 89
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

Joined: May 11, 2010
Posts: 37
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Coverting issue from type of java.util.Calendar to integer value
 
Similar Threads
Problem With Indexed Property
Padding for Numeric values
Clear validation message dynamically for the Datepicker
how to add a row dynamically in panel grid by clicking on command button using jsf
Html generated by JSF TAG <h:inputText/>