[英]jQuery does not work anymore after re-rendring any RichFaces component
[英]RichFaces component rich:input does not seem to work with JQuery
繼續將JQuery與RichFaces組件一起使用時,我注意到當您導入一個JQuery腳本,尤其是以下一個腳本時:“ http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min。 js”,RichFaces組件之一,“ rich:inplaceInput”,似乎無效。 輸入出現,但是使用的javascript消失了,因此,無論您單擊多少次,都不會發生任何事情。 這是我的標題:
<f:view>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/custom-styles.css" />
<script type="text/javascript" src="../../js/customJS.js"></script>
<a4j:loadScript src="resource:///jquery.js"/>
</head>
</html>
</f:view>
然后在主體中創建一個簡單的面板,並在其中創建一個簡單的面板和一個簡單的就地輸入:
<rich:panel id="simplePanel" style="width:560px;height:100px;">
<rich:inplaceInput id="sample" defaultLabel="Some text" />
</rich:panel>
就是這樣,並且僅當我刪除第一個腳本導入(包括“ jquery.min” javascript文件)的腳本時,它才起作用。
知道為什么會這樣嗎? 這是RichFaces中的錯誤嗎? 是否有解決方法,還是只有在升級RichFaces之后才可能? (我正在使用3.3.3版本)
感謝你的幫助。
我不熟悉Richfaces,但似乎jquery附帶了它
並且可以像這樣使用(參考內置的jQuery版本)
<a4j:loadScript
src="resource:///org/richfaces/renderkit/html/scripts/jquery/jquery.js" />
當您嘗試導入另一個jQuery.js
文件時,會導致沖突...
了解更多...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.