Foren

liferay_ui editor

thumbnail
laxman teja, geändert vor 11 Jahren.

liferay_ui editor

Junior Member Beiträge: 30 Beitrittsdatum: 17.04.12 Neueste Beiträge
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
jelmer kuperus, geändert vor 11 Jahren.

RE: liferay_ui editor

Liferay Legend Beiträge: 1191 Beitrittsdatum: 10.03.10 Neueste Beiträge
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
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: liferay_ui editor

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
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