File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF <t:inputCalendar> tag incompatible with Jquery!!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF <t:inputCalendar> tag incompatible with Jquery!!!!" Watch "JSF <t:inputCalendar> tag incompatible with Jquery!!!!" New topic

JSF <t:inputCalendar> tag incompatible with Jquery!!!!

Asish Chakraborty

Joined: Jul 05, 2011
Posts: 1
In a project using JSF, I am importing the Jquery library(jquery.min.js) to do some ajax call. In the same page I have a <t:inputCalendar> tag as follows.

<t:inputCalendar id="neweffectivePerioddateFrom" forceIdIndex="false" value="#{a.fromDate}"
styleClass="TextBoxStyle" align="right" popupDateFormat="MMM-dd-yyyy" renderAsPopup="true"
renderPopupButtonAsImage="true" style="width:150" maxlength="11" popupButtonImageUrl="/images/Icon_calendar.gif"
onmousedown="return clickIcon(this)" onkeydown="return clickIcon(this)" title="Enter the start date" popupLeft="true" >
<f:convertDateTime pattern="MMM-dd-yyyy" timeZone="IST" />

The problem is that when the calendar comes as a pop-up and I try to select a date, nothing happens. I am not even able to close the calendar pop-up. But when I remove the Jquery part along with the import part of the Jquery library, the calendar works!!!

Not having any idea about it. Please help.
Inna Za

Joined: Sep 20, 2012
Posts: 2

This is a conflict of jquery.js and prototype.js. This inputCalendar uses Prototype is a JavaScript Framework. Conflict is near the usage of $ symbol.
To fix this problem you can use this code, that you put after your java scripts includes:

you will declare another symbol for jquery and then you can use calls of jquery methods like this
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

That was over a year ago. Probably didn't help him.

Oh well...

An IDE is no substitute for an Intelligent Developer.
Inna Za

Joined: Sep 20, 2012
Posts: 2

Tim Holloway wrote:That was over a year ago. Probably didn't help him.

Oh well...

I've decided to answer because I had the same trouble. It may help someone else next year :-)
Natalio Bond

Joined: Nov 15, 2013
Posts: 1
Thank you for posting! It helped me! :)
Greg Charles

Joined: Oct 01, 2001
Posts: 2969

Welcome to Java Ranch, Natalio! I hope you'll stick around now and learn some more, and maybe answer a few questions yourself!

Actually, this helps me too despite its age. I've just been using the full word jQuery in place of $ in my JSF/RichFaces app because of the conflict. It also works, but I didn't think of defining $j. That will save some typing.
I agree. Here's the link:
subject: JSF <t:inputCalendar> tag incompatible with Jquery!!!!
It's not a secret anymore!