Primefaces拡張CKeditorを使用しようとしており、動作させることができません。 SOに関する同様の質問はすべて、リソース管理者を含まないことに起因しています。私はそれを行いました。ブラウザにJavaScriptエラーが表示されている可能性があります。以下のコードは、サイズ調整可能なテキストエリアボックスのみをレンダリングします。Primefaces CKeditorはレンダリングしません
<?xml version='1.0' encoding='UTF-8' ?>
<!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://xmlns.jcp.org/jsf/html"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<f:view>
<h:body>
<h:form>
<pe:ckEditor id="editor" value="Test">
</pe:ckEditor>
</h:form>
</h:body>
</f:view>
</html>
これは、これは私がブラウザ
test.xhtml:8 Uncaught ReferenceError: $ is not defined
で取得エラーであり、これはブラウザ
<h:inputText></h:inputText><textarea id="editor" name="editor">test</textarea><script id="editor_s" type="text/javascript">$(function(){PrimeFaces.cw("ExtCKEditor","widget_editor",{id:"editor",height:"200px",width:"600px",readOnly:false,advancedContentFilter:true});});</script>
に出力関連するHTMLコードである私のPOM
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.1</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>6.1.0</version>
</dependency>
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>resources-ckeditor</artifactId>
<version>6.1.0</version>
</dependency>
です
私はなぜthは動作していない、それはすべてが正しいように思える。
$が定義されていないとは、適切なjQueryライブラリをインポートするのを忘れた可能性があることを意味します。 – Tiny
@Tiny、ありがとう - JSFやPrimefacesは、これらのフレームワークがそれを処理すると思われるので、どこかで壊れていることを意味する必要があります。それともMavenが必要な依存関係をダウンロードしていないのでしょうか? – JHRS