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 8634687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:47:04+00:00 2026-06-12T09:47:04+00:00

I am using Richfaces 3.3 with seam. I have a <rich:calendar> component and I

  • 0

I am using Richfaces 3.3 with seam. I have a <rich:calendar> component and I need to highlight multiple dates in it. I need to set that dates dynamically at runtime.
Is this possible with <rich:calendar> component?
Thanks.

  • 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-06-12T09:47:05+00:00Added an answer on June 12, 2026 at 9:47 am

    You cannot select more than one date (<rich:calendar/> serves as input for a date field), you can however colorize some days in a different way than others. These are your options:

    1. Disable (gray out) all dates except those you want to highlight. This forbids the user from selecting dates not enabled. You need to implement a javascript function that takes a “day” parameter and returns true or false if the date should be enabled or not. Then specify the function in the isDayEnabled attribute of <rich:calendar/> (for example <rich:calendar isDayEnabled="dayEnabledFunction" />).

    2. Apply different classes to the dates you want: this allows the user to select any date but still highlights the dates you want. Create a css class and apply that class only to the dates you want. Again, implement a javascript function that takes a “day” parameter and returns a string with the name of the class you want applied. Return an empty string for the dates you don’t want highlighted and your new css class name for the dates you want highlighted. Then specify the function in the dayStyleClass attribute of <rich:calendar/> (for example <rich:calendar dayStyleClass="dayStyleFunction" />).

    To pass the dates to the javascript function, your server side should generate appropriate JavaScript code, for example:

    <script type="text/javascript">
        highlightDates = new Array();
        #{myComponent.dateList}
    </script>
    

    The MyComponent code:

    @Named("myComponent")
    public class MyComponent implements Serializable {
    
        // The list of dates to highlight, taken from somewhere
        private List<Date> dates;
    
        public String getDateList() {
            StringBuilder sb = new StringBuilder();
            // Iterate the list of dates and add a javascript push
            // for each date and return the resulting string.
            for (Date d : dates) {
                sb.append("highlightDates.push(new Date(");
                sb.append(d.getTime());
                sb.append(");\n");
            }
            return sb.toString();
        }
    }
    

    An example of how the javascript function dayStyleClass="dayFunc" works follows. This assumes you have jQuery (richfaces requires it) and used the noconflict() function. We use the jQuery.inArray function, which returns the index of the value in an array, or -1 if the value is not in the array:

    function dayFunc(day) { 
        return jQuery.inArray(day, highlightDates) >= 0 ? 'highlighted' : 'normal'; 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to be able to make an Ajax call using JSF/Seam/RichFaces and have
I'm using RichFaces on my JSF2 application, and I need a way to have
I'm using Richfaces 3.3.3 and rich:calendar renders &# 252; instead of ü for month
I've got a problem using Richfaces-3.3.3 with JBoss-Seam 2.2 as my environment: I have
I am using RichFaces with seam and EJB3. Specifically I am using the rich:tree
I've got a login form that looks something like this, using RichFaces and Seam:
I am using Richfaces 4. I have a <rich:datatable /> with 4 columns. In
Using JSF2 and richfaces 4. I have two regions in my form with multiple
Using Richfaces 3.3.0GA, jsf 1.2_14 and facelets. I have a richfaces ModalPanel with an
I'm using RichFaces and I'm having problems with the fileUpload flash component + IE

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.