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

  • SEARCH
  • Home
  • 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 7618211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:20:47+00:00 2026-05-31T03:20:47+00:00

I’m using RichFaces 3.3.3 and been trying to figure out how to set the

  • 0

I’m using RichFaces 3.3.3 and been trying to figure out how to set the Time portion of Rich:Cal to be current System date instead of the Default 12:00 where the date pattern is dd/M/yyyy HH:mm . I am also not interested using DefaultTime attribute as its no use in my situation.

so Question is : Have i missed it or it is not possible to have current system time included when user selects a date cell?

2 – If the answer to above is not possible then what is the best way to implement such behaviour.

Would below be any good :

    <rich:calendar id="richCal1"                                
        value="#{cust.dateFrom1}"
        datePattern="dd/M/yyyy HH:mm"
        enableManualInput="true"
        <f:convertDateTime pattern="dd/M/yyyy HH:mm" type="both"/>
        <f:validator validatorId="#{cust.dateAppend}"/>
        <f:attribute name="richCalendar" value="RichCalendar1" />
    </rich:calendar>

So when user selects a date, in Backbean custom validator dateAppend i will determine the element the trigger was fired from using the UIComponent.getAttributes() which for above code will be richCalendar and hence know which backbean variable to update to overwrite default Time with System time. Sounds Hacky but i don’t know any other way and should work.

I’m posting here so in case the above approach is totally wrong someone can let me know or offer advice on alternatives. Thanks

UPDATE:

The above approach won’t work since Setters are called at update model not at apply request phase and therefore i cannot change the value of backbean variable when the event is fired.

there must be a way. Any hints would be greatly appreciated.

  • 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-31T03:20:48+00:00Added an answer on May 31, 2026 at 3:20 am

    You need to implement a custom CalendarDataModel and assign it as dataModel for the calendar.

    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    
    import org.jboss.seam.annotations.Name;
    import org.jboss.seam.annotations.intercept.BypassInterceptors;
    import org.richfaces.model.CalendarDataModel;
    import org.richfaces.model.CalendarDataModelItem;
    
    @Name("richCalendarDataModel")
    @BypassInterceptors
    public class RichCalendarDataModel implements CalendarDataModel {
    
    
        public CalendarDataModelItem[] getData(Date[] arg0) {
            RichCalendarDataItem[] date = new RichCalendarDataItem[arg0.length];
            int i = 0;
            for (Date dd : arg0) {
                Date myCustomDate = ...; //create your custom date here from original dd
                RichCalendarDataItem tmp = new RichCalendarDataItem(myCustomDate, true);
                date[i] = tmp;
                i++;
            }
    
            return date;
        }
    
    
        public Object getToolTip(Date arg0) {
            ...
        }
    
    }
    

    calendarDataModelItem:

    import java.util.Date;
    
    import org.richfaces.model.CalendarDataModelItem;
    
    public class RichCalendarDataItem implements CalendarDataModelItem {
    
    private Date data;
    
    private boolean enabled;
    
    public RichCalendarDataItem(Date dd, boolean en) {
        data = dd;
        enabled = en;
    }
    
    public int getDay() {
        return 0;
    }
    
    public Object getData() {
        return data;
    }
    
    public String getStyleClass() {
        return null;
    }
    
    public Object getToolTip() {
        return null;
    }
    
    public boolean hasToolTip() {
        return false;
    }
    
    public boolean isEnabled() {
        return enabled;
    }
    

    }

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:

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.