掲示板

Liferay-ui:editor

thumbnail
15年前 に vaseem bari . によって更新されました。

Liferay-ui:editor

Junior Member 投稿: 86 参加年月日: 08/03/26 最新の投稿
I have inserted a liferay editor in a custom portlet, it works fine when adding the data,
In edit section, it is not retriving some data, like coloued or some formated data, and also
it prints out side the editor, editor text area will be empty.
Please find the attached file for referance.
15年前 に raju komari によって更新されました。

RE: Liferay-ui:editor

New Member 投稿: 6 参加年月日: 09/03/02 最新の投稿
hi vaseem please tell me ur editing question and answer in single editor or ur editing only answer?

but what u written in text file is textarea is taken for question only? here not clear that point.

that means editor is applying to question or answer to edit the content of that ?
thumbnail
15年前 に vaseem bari . によって更新されました。

RE: Liferay-ui:editor

Junior Member 投稿: 86 参加年月日: 08/03/26 最新の投稿
Thanks Raju,

I am editing only answer, my code is like this
<script type="text/javascript">
function <portlet:namespace />initEditor() {
return document.faq.editanswer.value ;
}
</script >
<liferay-ui:input-editor editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" />
<input name="editanswer" type="hidden" value=" <%=faqbean.getAnswer()%>" />
<!--textarea rows="5" cols="90" id="editanswer" name="editanswer" ></textarea--> </td>
</tr>

Here i have commented the text area, you can see. To Initeditor () i am giving the content through {document.faq.editanswer.value}. but in journal article they are giving the date thouth <%= UnicodeFormatter.toString(content) %>.

but if i give my java value ie <%=faqbean.getAnswer()%> it is throughing an error, please advice.

Rgds

Vaseem
15年前 に raju komari によって更新されました。

RE: Liferay-ui:editor

New Member 投稿: 6 参加年月日: 09/03/02 最新の投稿
<span id="html" style="DISPLAY:inline">
 <textarea id="messagebody" name="messagebody" style="height: 170px; width: 500px;">  					  
&lt;%=faqbean.getAnswer()%&gt;" /&gt;
</textarea>
<script language="javascript">	
generate_wysiwyg('messagebody');
</script>
</span>

this is code i am using in my portlet.

u must pass java answer variable to that text area after that add script tag to add editor using function which u written.


i hope it will help you please see above code





Thanks&Regards
raj
thumbnail
15年前 に Suhail Ahmed によって更新されました。

RE: Liferay-ui:editor

Regular Member 投稿: 126 参加年月日: 08/01/02 最新の投稿
vaseem bari .:
I have inserted a liferay editor in a custom portlet, it works fine when adding the data,
In edit section, it is not retriving some data, like coloued or some formated data, and also
it prints out side the editor, editor text area will be empty.
Please find the attached file for referance.




Hi Vaseem,


Try with this code,


&lt;%
	EmailTemplate template = (EmailTemplate)request.getAttribute("EmailTemplateObj");
	
	String [color=#F3100C]content[/color] = StringPool.BLANK;
	
	if(Validator.isNotNull(template) &amp;&amp; Validator.isNotNull(template.getMessage())){
		[color=#F3100C]content [/color]= template.getMessage();
	}
%&gt;



<script type="text/javascript">
	
	function initEditor() {
		return "<%= UnicodeFormatter.toString([color=#F3100C]content[/color]) %>";
	}
</script>


&lt;%!

public static final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.portal-web.docroot.html.portlet.journal.edit_article_content_xsd_el.jsp";
%&gt;



Regards,

Suhail Ahmed
thumbnail
15年前 に vaseem bari . によって更新されました。

RE: Liferay-ui:editor

Junior Member 投稿: 86 参加年月日: 08/03/26 最新の投稿
Thanks you for replying to all.
i got the solution , like this.

<%
String content1 = faqbean.getAnswer() ;
%>
<script type="text/javascript">
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content1) %>";
}
</script >
<liferay-ui:input-editor editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" />
<input name="editanswer" type="hidden" value="" />


Thanks

Vaseem Bari
thumbnail
10年前 に Sagar A Vyas によって更新されました。

RE: Liferay-ui:editor

Liferay Master 投稿: 679 参加年月日: 09/04/17 最新の投稿
vaseem bari:
Thanks you for replying to all.
i got the solution , like this.

<%
String content1 = faqbean.getAnswer() ;
%>
<script type="text/javascript">
function <portlet:namespace />initEditor() {
return "<%= UnicodeFormatter.toString(content1) %>";
}
</script >
<liferay-ui:input-editor editorImpl="<%= EDITOR_WYSIWYG_IMPL_KEY %>" />
<input name="editanswer" type="hidden" value="" />


Thanks

Vaseem Bari


Thanks Vaseem for this post.

Can please tell me what is "EDITOR_WYSIWYG_IMPL_KEY" here is this remain same for our custom portlet too ?

Thanks,
Sagar Vyas