-
1. richfaces 4 jQuery built in
mp911de Feb 28, 2011 2:06 PM (in response to xilosh)Hi Silvestre,
RF4 contains jQuery. It's loaded automatically when you use some JavaScripted componets (i.e. rich:calendar). You can initialize jQuery on you Page (when you don't have any JavaScripted RichFaces-Components) with rich:jQuery:
This is a small sample:
<h:head>
<rich:jQuery />
</h:head>
<body>
<h:form>
<h:outputLink value="javascript:alert($('.dummy'));">Test</h:outputLink>
</h:form>
</body>
And then it just goes $('something')....
Best regards,
Mark
-
2. Re: richfaces 4 jQuery built in
xilosh Feb 28, 2011 3:57 PM (in response to mp911de)Hi Mark
Thanks for the repply. it does not work for me I've created a simple page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" > <h:head> <rich:jQuery /> </h:head> <h:body> <p id="p_test">hello world</p> <a href="#" onclick="javascript:alert(jQuery('#p_test'))">Test</a> </h:body> </html>
When I try to load the page it has javascript errors
Error: RichFaces is not defined
Archivo de origen: http://localhost:8080/media/common/test.jsf#
Línea: 3
Error: jQuery is not defined
Archivo de origen: http://localhost:8080/media/javax.faces.resource/jquery.component.js.jsf?ln=org.richfaces
Línea: 78
if I try with $ instead of jQuery same error occurs
i'm using richfaces version 4.0.0.20110209-M6, I was looking for jquery library inside the jars but I cant find it. I version 3.3.2 there is a jquery.js file inside org.richfaces.renderkit.html.scripts.
Kind regards
-
-
4. richfaces 4 jQuery built in
xilosh Feb 28, 2011 6:24 PM (in response to boy18nj)Thanks aman.
a4j:loadScript is not available on RF 4, there is similar feature in JSF 2 h:ouputScript but is not exactly the same.
-
5. richfaces 4 jQuery built in
xilosh Mar 1, 2011 3:29 AM (in response to xilosh)Solved!!!
I was not including richfaces-core-impl library.
Thank you.
-
6. richfaces 4 jQuery built in
kshanth Apr 5, 2011 4:56 PM (in response to xilosh)Add the following lines, hope it resolves in RF 4
<h:outputScript name="jsf.js" library="javax.faces" />
<h:outputScript name="jquery.js" />