about jquery.js, i think you don't have to include it since RichFaces 4 jars already bundled with jquery.js file, you can use RichFaces 4.2.1 resource routing to solve these conflicts, follow this article.
Thank you for the reply @Ibrahim.
I have not included jquery.js. I know that jquery.js is loaded by default when I use the <h:head> tag.
According to many many forums I have options to
1)Translate everything in jquery
2) Substitute $ in prototype.js by $$$
Are you suggesting that i use a previous version of jquery in which the error did not come?
I was trying to use Jquery.noConflict but I dont know where to use it.
I could just load the previous jquery used in Richfaces 3.3.2 from the method you suggested but fear it may lead to other problems in Richfaces 4 components.
Could you please suggest any other options? Thank you.
I have finally resolved the problem. Here are my findings. I hope this helps everyone who have been having these problems.
1) Richfaces 3.3.2 was based on prototype.js but now I think all the code have been changed to jquery. So the js files framework.pack.js and ui.pack.js have been unsupportive. These files are MISSING in Richfaces 4.
2) I used to the <head/> tag before loading anthing else and then used <head > after it so that the jquery loaded first before any other libraries.
So typically I did this
//Fader's original code
4) After that I used Jquery using JQuery instead of $.
Thank you for your help.
if i were in your place, i would prefer using prototype.js.
Thank you @Ibrahim!!!!