2016-08-10 35 views
0

我試圖用輸入編輯器創建一個liferay portlet。爲了做到這一點我使用:顯示liferay輸入編輯器

  • 的Liferay 6.2 GA5和Tomcat 7
  • Liferay的插件SDK 6.2 GA5
  • 的Liferay IDE在Eclipse捆綁,3.0.0 GA1

我試着創建一個包含以下內容的portlet:

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> 
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %> 
<%@ page import="com.liferay.portal.kernel.util.UnicodeFormatter" %> 

<portlet:defineObjects /> 

<aui:button-row cssClass="guestbook-buttons"> 
    <aui:button value="TESTING"></aui:button> 
</aui:button-row> 

<liferay-ui:input-editor initMethod="initEditor" name="mieditor"> 
<script type="text/javascript"> 
    function <portlet:namespace />initEditor() { 
     return "<%= UnicodeFormatter.toString("working") %>"; 
    } 
</script> 
</liferay-ui:input-editor> 

Editor up. 

前面指示的代碼創建一個帶有按鈕和輸入的portlet編輯器,但它不顯示編輯器,只有按鈕和句子Editor up。你可以看到我的意思的圖片:

enter image description here

你知道爲什麼portlet不顯示輸入編輯器?

在此先感謝!

回答

1

你錯過了包括Liferay的-UI taglib.Just它添加到你的JSP

<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> 

以備將來參考,如果你是在一個IDE開發,它會向您顯示未知標籤的警告,因此無法解析標籤或其特殊用法。

+0

就是這樣,萬分感謝!問題是我沒有收到未知標籤的警告,這就是爲什麼我沒有得到問題的原因。 –

0

只要您可以使用合金CkEditor或FCKeditor。 合金CKEditor的Click here

FCKEditor的click here

+0

我試圖使用FCKEditor,但我得到了以下錯誤:'absolut uri:http://java.fckeditor.net無法在web.xml或使用此應用程序部署的jar文件中解析' –

0

Liferay在自己的liferay-ui taglib內部實現了CKEditor。

如果你想使用它dinamically我建議你tinymce編輯器,你可以自己定製自己的頁面與您的需求。