Meaningless Drivel is fun!*
The moose likes JSF and the fly likes JQuery not working in JSF 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JQuery not working in JSF 2.0" Watch "JQuery not working in JSF 2.0" New topic
Author

JQuery not working in JSF 2.0

Rehab Bozic
Greenhorn

Joined: Apr 10, 2011
Posts: 4
I am trying to use JQuery full calendar ( http://arshaw.com/fullcalendar/ ) in my xhtml page that looks like this:

>
</html>

I have defined I am trying to use JQuery full calendar ( http://arshaw.com/fullcalendar/ ) in my xhtml page that looks like this:

[code=java]
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
<title>Sign in</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel='stylesheet' type='text/css' href='./fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='./fullcalendar/fullcalendar.print.css' media='print' />
<script type='text/javascript' src='./jquery/jquery-1.5.2.min.js'></script>
<script type='text/javascript' src='./jquery/jquery-ui-1.8.11.custom.min.js'></script>
<script type='text/javascript' src='./fullcalendar/fullcalendar.min.js'></script>


<script type='text/javascript'>
$j = jQuery.noConflict(); so there is no conflict, I have also tried putting .js files in resource files and loading them with <hutputScript> but no sucess.

I am using rich faces 4.0 and JSF 2.0. I have no exceptions or errors, but the page is just no loading, ie I don't have calendar in appropriate 'calendar' div tag.
Can anyone suggest solution for this problem?
Rehab Bozic
Greenhorn

Joined: Apr 10, 2011
Posts: 4
Ok, sorry for that, the actual page looks like this:


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

RichFaces has a pretty powerful calendar control itself. If you can use it, that should be less trouble.

Otherwise, you might want to look at the RichFaces <a4j:script > element, which is designed to allow references to JavaScript resources in a JSF-friendly way.

RichFaces uses jQuery internally, and it mostly works well with user-supplied jQuery code as well, but there are cases (and versions) where problems have come up. so it's worth doing a web search.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: JQuery not working in JSF 2.0
 
Similar Threads
change event is firing twice
json object send to JSF backing bean to xhtml page
rich:hotKey worked when using jQuery?
Drop Down Menu Problem
Embedding Flex component in JSF 2.0