掲示板
Liferay-ui:editor
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.
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 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 ?
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 ?
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
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
<span id="html" style="DISPLAY:inline">
<textarea id="messagebody" name="messagebody" style="height: 170px; width: 500px;">
<%=faqbean.getAnswer()%>" />
</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
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,
<%
EmailTemplate template = (EmailTemplate)request.getAttribute("EmailTemplateObj");
String [color=#F3100C]content[/color] = StringPool.BLANK;
if(Validator.isNotNull(template) && Validator.isNotNull(template.getMessage())){
[color=#F3100C]content [/color]= template.getMessage();
}
%>
<script type="text/javascript">
function initEditor() {
return "<%= UnicodeFormatter.toString([color=#F3100C]content[/color]) %>";
}
</script>
<%!
public static final String EDITOR_WYSIWYG_IMPL_KEY = "editor.wysiwyg.portal-web.docroot.html.portlet.journal.edit_article_content_xsd_el.jsp";
%>
Regards,
Suhail Ahmed
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
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
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