[英]Richfaces tree is giving me an “Uncaught ReferenceError tree is not defined”
[英]JSF app with the error: Uncaught ReferenceError: RichFaces is not defined
應用程序已遷移,現在在打開 een 頁面時出現問題,在控制台中我看到錯誤:“Uncaught ReferenceError: RichFaces is not defined”這是 Weblogic 服務器上的 Java 應用程序。 JSF 是舊的,但應用程序對我來說是新的,我還沒有構建應用程序。
這是代碼的一部分:
<?xml version="1.0" encoding="UTF-8"?>
<f:view
contentType="text/html"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:win="http://winter.ba.uwv.nl/winter"
>
<html>
<h:head>
...
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<h:outputScript name="/javascript/jquery.timers.js" target="head" />
<h:outputScript name="/javascript/preloadCssImages.jQuery_v5.js" target="head" />
<h:outputScript name="/javascript/tooltip.js" target="head" />
<rich:jQuery />
<ui:remove><!-- Disable the a4j:loadStyle tags and enable the link tag to use plain setup --> </ui:remove>
<ui:insert name="head"/>
<h:outputScript target="head">
jQuery(document).ready(function() {
jQuery.preloadCssImages();
...
});
</h:outputScript>
</h:head>
<h:body>
...
<rich:jQuery />行導致:
<span id="j_idt7" style="display: none;">
<script type="text/javascript">RichFaces.ui.jQueryComponent.query();</script>
</span>
和行RichFaces.ui.jQueryComponent.query(); 導致錯誤:
未捕獲的 ReferenceError:RichFaces 未在 home.xhtml:13:152(匿名)@home.xhtml:13 中定義
我不明白為什么要在頭部添加一個 <span...> 標簽? 在我看來,但我不確定是否遺失了神器。 我試圖將以下工件添加到我的 pom.xml 文件中:
有人知道如何解決“Uncaught ReferenceError: RichFaces is not defined”錯誤嗎?
----更新(在 Makhiel 的回答之后)----
未捕獲的類型錯誤:jQuery.preloadCssImages 不是 HTMLDocument 中的 function。 (userList.xhtml:17:28) 在 l (jquery-1.8.3.min.js:2:16996) 在 Object.fireWith [as resolveWith] (jquery-1.8.3.min.js:2:17783) 在Function.ready (jquery-1.8.3.min.js:2:12504) 在 HTMLDocument.A (jquery-1.8.3.min.js:2:9909)
<html> <head id="j_idt2"> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <script> /* Fix image caching problem */ try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {} </script> <title>Winter</title> <link rel="icon" href="/winter/favicon.ico" type="image/x-icon" /> <script src="https://code.jquery.com/jquery-1.8.3.min.js"></script> <,-- This is the line of Makhiel mentioned. so it exists --> <script type="text/javascript" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.5.17.Final/PackedCompressed/packed/packed:js"></script> <span id="j_idt9" style="display; none."> <script type="text/javascript">RichFaces.ui.jQueryComponent;query().</script> </span>... <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-base-component.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.component.js"> <script type="text/javascript"> jQuery(document).ready(function() { jQuery;preloadCssImages(). //perhaps add delay..; }). </script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-queue.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/status.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/toolbar.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-event.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/togglePanel.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/togglePanelItem.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/collapsiblePanel.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/collapsiblePanelItem.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/message.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.position.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-utils.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/richfaces-selection.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/AutocompleteBase.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/Autocomplete.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanel.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanelBorders.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popupPanelSizer.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/component-control.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/popup.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menuKeyNavigation.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menu-base.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menu.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menugroup.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/menuitem.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/contextmenu.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/tooltip.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/datatable.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/jquery.mousewheel.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/extendedDataTable.js"></script> <script type="text/javascript" src="/winter/org.richfaces.resources/javax.faces.resource/org.richfaces/datascroller.js"></script>... </head> <body>...
rich:jQuery
沒有任何屬性沒有任何作用,所以你最好刪除它。
您不需要在 POM 中添加任何內容,如果 JSF 不知道 richfaces 標簽是什么,它就不會翻譯它。
您生成的<head>
應該包含 RichFaces JS 源,類似於:
<script type="text/javascript" src="/org.richfaces.resources/javax.faces.resource/org.richfaces.staticResource/4.5.17.Final/PackedCompressed/packed/packed.js"></script>
這是定義 RichFaces object 的地方,如果它不在您的頁面上(聽起來好像不在),您可能有一個阻止它的過濾器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.