Posted by: Reisang Risom | February 4, 2009

JSF Calendar Component Issues

It was on the 2nd of Feb 2009 that I came across the issue with jsf calendar component. The issues was due to the calendar renderer class rendering only four rows of  the dates as all dates fitted within that, hence the javascript error for the missing row. The quick get around over this was to add an additional row if there was only four rows.

This will be a recurring issues when all dates of feb fits perfectly on four rows of the calendar.

You can download the webui.jar with the updated CalendarMonthRendered.class on the link below.

http://www.turboupload.com/files/get/6X_JJlLLRR/webui.jar

Code added on CalendarMonthRenderer.java is as below

if(rowNum==4)
{
writer.startElement(“tr”, calendarMonth);
String rowId = rowIdPrefix + rowNum++;
writer.writeAttribute(“id”, rowId, null);
writer.write(“\n”);
for(int i = 0; i < 7; i++)
{
boolean selected = calendarMonth.isDateSelected(startDate, endDate);
boolean dayInMonth = startDate.get(2) == displayedMonth;
String style = styles[19];
if(selected)
{
if(dayInMonth)
style = styles[20];
else
style = styles[21];
} else
if(dayInMonth)
if(calendarMonth.compareDate(startDate, todaysDate))
style = styles[22];
else
style = styles[18];
renderDateLink(startDate, style, dateLinkPrefix.concat(String.valueOf(dateLinkId)), calendarMonth, writer);
dateLinkId++;
startDate.add(6, 1);
startDate.getTime();
}

writer.endElement(“tr”);
}

Hope this save a trouble for few.


Responses

  1. Hi,

    Can you please provide me for JSF 1.1 also.

    Thanks in advance.

  2. it worked for me … thanks alot

  3. Im unable to download the jar you had uploaded. Can you please mail me to shivaji.byrapaneni@gmail.com

  4. we found one more bug in this jar.

    ERROR – Calendar is allowing to select back date, but when we click on any button it is not submitting the page and displays a msg ‘Select a date after 05/02/2009 ‘

    • Rao, maybe you should try checking your code. See if your date range properties are set as required.

  5. could not download the file.throwing JS error on the download link

    • Hi srini, try downloading using a different browser. That will help.

  6. please provide the link

  7. Hi

    Thanks for the update. It works for date, but I was having problems with tab set, it was not working. In order to update just calendar class, it is best just to replace class CalendarMonthRenderer from new jar to the old jar (webui.jar) that you have in rave folder. It works for me. Btw, can anyone show me some tutorial where I can migrate my projects from rave to woodstock.

    Thanks in advance
    Pero Gjuzelov

  8. hi

    we are using jsf 1.1.02, will it work for this version?

    we have added message for calendar to display validation messages.

  9. Thanks a lot..
    It really did helped a lot..
    Keep up the good job… :)

  10. Hi, great post and thanks for the info, since we have the same problem, problem is we use webui-jsf.jar will your solution still work or de we have to recompile the webui-jsf.jar

  11. Thank Reisang.I downloaded the jar.
    If we use the jar as the whole it is throwing validation errors of component.As Pero said , the best thing is to replace the CalendarMonthRenderer class and create jar using the updated class.

  12. Hi, is the webui.jar file that is being downloaded compiled using java 1.5 as opposed to 1.4? My app is deployed on websphere using java1.4 and I see a version 49.0 error when using the new webui.jar file.

    Cheers

  13. Hi..I am not able to download this jar file…Plz give another link or mail me at
    mandar9898@gmail.com

  14. I downloaded the above .jar file and the calendar pop-up came back, but so did a 500 error everytime I try to save the date now. Suggestions?

  15. Hi.

    Thanks for this great post.
    Can you please send me the jar file.
    I couldn’t download from the link you have provided above.
    My email is karen_05182002@yahoo.com.

    Thank you.

  16. Hello:
    I had exactly the same problem this Feb. I hope you post will solve my problem. I wonder how did you get the java source file. In web.ui-src.zip, there is not this java file. Did you decompiler the java with a decompiler?
    I wionder if you could send me the original java source for the whole web.ui.jar.

    thanks a lot. You did great job.

    John


Leave a response

Your response:

Categories