Home » Alloy UI » English

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
laxman teja
liferay_ui editor
7. Juli 2012 02:13

laxman teja

Rang: Junior Member

Nachrichten: 29

Eintrittsdatum: 16. April 2012

Neue Beiträge

this is my code in view.jsp

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

src code is

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

i coundn't retrive the value from data from jsp

plz help me in solving this problem
Jelmer Kuperus
RE: liferay_ui editor
7. Juli 2012 03:34

Jelmer Kuperus

Rang: Liferay Legend

Nachrichten: 1192

Eintrittsdatum: 10. März 2010

Neue 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 :

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

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

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

Using javascript that could look like this

2    function <portlet:namespace />saveObject() {
3        document.<portlet:namespace />fm.<portlet:namespace />teja.value = window.<portlet:namespace />editor.getHTML();
4        submitForm(document.<portlet:namespace />fm);
5    }
Hitoshi Ozawa
RE: liferay_ui editor
7. Juli 2012 06:57

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7949

Eintrittsdatum: 23. März 2010

Neue Beiträge

jelmer gave a good reply. The following wiki page contains information if you're interested.

You may also be interested in the following wiki too.