Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Asish Chakraborty
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
C++ Chrome Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18156
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was over a year ago. Probably didn't help him.

Oh well...
 
Inna Za
Greenhorn
Posts: 2
C++ Chrome Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for posting! It helped me! :)
 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic