2017-05-19 11 views
0

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は動作していない、それはすべてが正しいように思える。

+0

$が定義されていないとは、適切なjQueryライブラリをインポートするのを忘れた可能性があることを意味します。 – Tiny

+1

@Tiny、ありがとう - JSFやPrimefacesは、これらのフレームワークがそれを処理すると思われるので、どこかで壊れていることを意味する必要があります。それともMavenが必要な依存関係をダウンロードしていないのでしょうか? – JHRS

答えて

0

私は、プライムフェイスを起動してリソース(js、css)をヘッドに投入するために、少なくとも1つのPrimefacesコンポーネントがページに存在する必要があると確信しています。

は例

<p:outputLabel style="display:none"/> 

、あまりにも名前空間(xmlns:p="http://primefaces.org/ui")を追加するために、そこに何かを入れてみてください。

+0

応答のおかげで、間違いなく、ショットの価値があったが、愛 – JHRS

関連する問題