my dog learned polymorphism*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF <t:inputCalendar> tag incompatible with Jquery!!!!" Watch "JSF <t:inputCalendar> tag incompatible with Jquery!!!!" New topic
Author

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

Asish Chakraborty
Greenhorn

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" />
</t:inputCalendar>


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
Greenhorn

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: 15950
    
  19

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

Oh well...


Customer surveys are for companies who didn't pay proper attention to begin with.
Inna Za
Greenhorn

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
Greenhorn

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

Joined: Oct 01, 2001
Posts: 2833
    
  11

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSF <t:inputCalendar> tag incompatible with Jquery!!!!
 
Similar Threads
JSF- tomahawk calander problem
t:div, s;fieldset and t::inputCalendar confilict
Problems with rich:calendar
pls help in t:calander i need it badly pls help
validation of two calendars