掲示板

liferay_ui editor

thumbnail
11年前 に laxman teja によって更新されました。

liferay_ui editor

Junior Member 投稿: 30 参加年月日: 12/04/17 最新の投稿
this is my code in view.jsp


<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<portlet:defineObjects />
<portlet:actionURL var="actionUrl"/>
<form action="<%=actionUrl.toString()%>" method="post">
<liferay-ui:input-editor name="teja" />
<input type="submit">
</form>

src code is

public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
String s=actionRequest.getParameter("teja");
String s1=ParamUtil.getString(actionRequest,"teja");
System.out.println("*******************"+s+"*******************************"+s1);
}

i coundn't retrive the value from data from jsp

plz help me in solving this problem
thumbnail
11年前 に jelmer kuperus によって更新されました。

RE: liferay_ui editor

Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
The input-editor component does not submit it's value automatically

On page load you should initialize the value from javascript like this :


	function <portlet:namespace />initEditor() {
		return "&lt;%= UnicodeFormatter.toString(BeanParamUtil.getString(objectYouLoadedFromTheDatabaseInCaseOfAnEdit, request, "teja")) %&gt;";
	}


And before submitting the form you should save the html the user entered to a hidden form field that could look like this

<aui:input name="teja" type="hidden" />


Using javascript that could look like this


	function <portlet:namespace />saveObject() {
		document.<portlet:namespace />fm.<portlet:namespace />teja.value = window.<portlet:namespace />editor.getHTML();
		submitForm(document.<portlet:namespace />fm);
	}
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: liferay_ui editor

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
jelmer gave a good reply. The following wiki page contains information if you're interested.

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/How+to+add+a+wysiwyg+html+editor+to+a+portlet

You may also be interested in the following wiki too.
http://www.liferay.com/web/erik.andersson/blog/-/blogs/11490753