加载jquery插件时richfaces页面不工作
在我的项目中,我使用外部jquery创建图表。但是在使用jquery之后,我的项目中没有任何操作。我在项目中加载highChart piechart jquery。加载jquery插件时richfaces页面不工作,jquery,jsp,jsf,richfaces,pie-chart,Jquery,Jsp,Jsf,Richfaces,Pie Chart,在我的项目中,我使用外部jquery创建图表。但是在使用jquery之后,我的项目中没有任何操作。我在项目中加载highChart piechart jquery。 即使我使用jQuery.noConflict()。但是没有用 我有两个静态页面(parent.jsp,leftsidemenu.jsp)和一个动态包含页面(rightside1.jsp,rightside2.jsp…)。 父页面有两部分(左侧和右侧) 步骤1:登录后,一些菜单显示在左侧,图表显示在右侧。(此图表使用jQuery填充。
即使我使用jQuery.noConflict()。但是没有用 我有两个静态页面(parent.jsp,leftsidemenu.jsp)和一个动态包含页面(rightside1.jsp,rightside2.jsp…)。 父页面有两部分(左侧和右侧) 步骤1:登录后,一些菜单显示在左侧,图表显示在右侧。(此图表使用jQuery填充。) 第2步:如果我单击左侧的菜单,则右侧部分会发生动态变化。
但是在我使用jquery之后,leftsidemenu操作不起作用。
若我点击左边的任何菜单,那个么它就不会执行任何操作 parent.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body id="parentBody">
<rich:page id="parentRichPage" sidebarPosition="left" sidebarWidth="260">
<f:facet name="sidebar">
<a4j:outputPanel id="sideBarOutputPanelId">
<!-- Left side menuse -->
<jsp:include page="leftsidemenu.jsp" flush="true" />
</a4j:outputPanel>
</f:facet>
<rich:layout>
<rich:layoutPanel position="center" width="70*">
<a4j:outputPanel id="rightSidePanelId">
<f:verbatim>
// Here dynamic include the page depend upon leftside menu clicked
<jsp:include page="${ParentBean.rightSidePage}" flush="true"/>
</f:verbatim>
</a4j:outputPanel>
</rich:layoutPanel>
</rich:layout>
</rich:page>
</body>
</f:view>
</html>
<rich:panelMenuGroup id="leftSideLink" label="leftside1">
<a4j:support action="#{LeftSideBean.showRightSidePieAction1}"
event="onclick"
reRender="rightSidePanelId"/>
<rich:panelMenuItem id="leftSide2">
<a4j:commandLink id="leftSideMenuLink2"
value="ShowPage2"
action="# {LeftSideBean.showRightSideAction2}"
reRender="rightSidePanelId"/>
</rich:panelMenuItem>
<rich:panelMenuItem id="leftSide3">
<a4j:commandLink id="leftSideMenuLink3"
value="ShowPage3"
action="# {LeftSideBean.showRightSideAction3}"
reRender="rightSidePanelId"/>
</rich:panelMenuItem>
//此处动态包含页面取决于单击的左侧菜单
leftsidemenu.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body id="parentBody">
<rich:page id="parentRichPage" sidebarPosition="left" sidebarWidth="260">
<f:facet name="sidebar">
<a4j:outputPanel id="sideBarOutputPanelId">
<!-- Left side menuse -->
<jsp:include page="leftsidemenu.jsp" flush="true" />
</a4j:outputPanel>
</f:facet>
<rich:layout>
<rich:layoutPanel position="center" width="70*">
<a4j:outputPanel id="rightSidePanelId">
<f:verbatim>
// Here dynamic include the page depend upon leftside menu clicked
<jsp:include page="${ParentBean.rightSidePage}" flush="true"/>
</f:verbatim>
</a4j:outputPanel>
</rich:layoutPanel>
</rich:layout>
</rich:page>
</body>
</f:view>
</html>
<rich:panelMenuGroup id="leftSideLink" label="leftside1">
<a4j:support action="#{LeftSideBean.showRightSidePieAction1}"
event="onclick"
reRender="rightSidePanelId"/>
<rich:panelMenuItem id="leftSide2">
<a4j:commandLink id="leftSideMenuLink2"
value="ShowPage2"
action="# {LeftSideBean.showRightSideAction2}"
reRender="rightSidePanelId"/>
</rich:panelMenuItem>
<rich:panelMenuItem id="leftSide3">
<a4j:commandLink id="leftSideMenuLink3"
value="ShowPage3"
action="# {LeftSideBean.showRightSideAction3}"
reRender="rightSidePanelId"/>
</rich:panelMenuItem>
rightside1.jsp此页面有一个使用jquery的图表
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="rightSide1SubviewId">
<f:verbatim><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<a4j:loadScript src="../../scripts/jquery-1.3.2.min.js"/>
<a4j:loadScript src="../../scripts/jquery.min.js"/>
<a4j:loadScript src="../../scripts/highcharts.js"/>
<script type="text/javascript">
jQuery.noConflict();
$(document).ready(function()
{
// Here i already wrote a script for loading chart.
});
</script>
</head>
<body>
</f:verbatim>
<a4j:outputPanel id="rightSideChartPanel">
<rich:simpleTogglePanel id="toggleId" switchType="client" label="Charte Management" >
<div id="container" style="width: 350px; height: 250px; margin: 0 auto"></div>
</rich:simpleTogglePanel>
</a4j:outputPanel>
<f:verbatim>
</body>
</f:verbatim>
</f:subview>
<f:verbatim>
jQuery.noConflict();
$(文档).ready(函数()
{
//在这里,我已经编写了一个加载图表的脚本。
});
因为我不懂jsp。根据我的理解,请按如下所示更改jquery声明。您是否有任何错误?请使用firebug进行检查…向我们展示您的jquery代码,以便我们可以分析出现的错误?我还使用highchart graph。首先,我面临许多问题。我的错误是$.conflict()中的声明错误。所以我建议你。谢谢你的回复。我的测试方法如下:1。使用你的代码。但没有回应。2.我只是加载那个插件。无法访问该查询。即使我有同样的问题。我检查它$.conflict()。但没有更多的改善。这意味着,当我使用jquery时,将显示饼图。但是菜单操作不起作用。将jquery版本升级到1.4.2可能会解决您的问题Hi vivek。谢谢你的支持。我使用两个查询:1。jquery-1.3.2.min.js和2.jquery.min.js。我要替换哪个jquery