Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6241013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:40:42+00:00 2026-05-24T11:40:42+00:00

I have noticed that numerous Date methods in Java have been deprecated, but rather

  • 0

I have noticed that numerous Date methods in Java have been deprecated, but rather most people tell me to use Calender.

Here is my problem. I am trying to create a Calendar where you can select a date and within Java set the date. So I have

public class someClass
{

    private Date startDate;
    private Date endDate;

    public void setStartDate(Date date) 
    {
        this.startDate = date;
    }

    public void setEndDate(Date date) 
    {
        this.endDate = date;
    }   

    public Date getStartDate()
    {
        return this.startDate;
    }

    public Date getEndDate() 
    {
        return this.end;
    }

}

with the RichFaces code

<rich:calendar popup="true" mode="ajax"  value="#{someClass.startDate}"/>

When I manually set it up in code it seems to show up, but when I change to a different date it never sets the date.

I have also seen that within calendars they tell me to use
Calendar. But when I type in Calenders.Time. it’s not in Java, is it because it’s protected? How does it work with RichFaces? Can RichFaces access it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:40:45+00:00Added an answer on May 24, 2026 at 11:40 am

    As to the concrete question of “How to use java.util.Calendar with <rich:calendar>?”, just bind the component to Calendar#getTime() which in turn returns a fullworthy java.util.Date.

    E.g.

    public class Bean {
    
        private Calendar startDate;
    
        public Bean() {
            startDate = Calendar.getInstance(); // You need to prepopulate it.
        }
    
        // ...
    }
    

    with

     <rich:calendar value="#{bean.startDate.time}" />
    

    But that will not solve the real problem of the value not being set in the model. This is caused by something else. Don’t get mislead by the deprecated methods of Date. Using Date in <rich:calendar> is perfectly fine. You only shouldn’t be using those deprecated methods to set the year/month/day/etc of the date programmatically yourself like as in bean’s constructor.

    Your real problem can have many causes. Perhaps the <rich:calendar> isn’t been placed in a <h:form>? Perhaps you’re nesting multiple <h:form> components? Perhaps you’ve somewhere an immediate="true"? Perhaps you’re grabbing/debugging the value at the wrong moment? Etc..etc..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working with the Joomla framework and I have noticed that they use
I have noticed that regardless of a given script's execution time, every date() call
Since upgrading to 2008 I and many people here have noticed that randomly VS
I have noticed that numerous books, etc. on COM point out that it is
I have noticed that the app Reeder is using the UIWebView but ignores this
I have noticed that while using the Substance UI for Java that when I
I have noticed that cURL in PHP returns different data when told to output
I have noticed that some apps like Safari and Mail show a loading indicator
I have noticed that my particular instance of Trac is not running quickly and
I have noticed that my geocoder is inconsistent in the code shown below because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.