フォーラム

ホーム » Alloy UI » English

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
laxman teja
liferay_ui editor
2012/07/07 2:13
答え

laxman teja

ランク: Junior Member

投稿: 28

参加年月日: 2012/04/16

最近の投稿

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
Jelmer Kuperus
RE: liferay_ui editor
2012/07/07 3:34
答え

Jelmer Kuperus

ランク: Liferay Legend

投稿: 1192

参加年月日: 2010/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 :

1
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

1
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
2012/07/07 6:57
答え

Hitoshi Ozawa

ランク: Liferay Legend

投稿: 7990

参加年月日: 2010/03/23

最近の投稿

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