Fórum

Creating My Greeting portlet tutorial doesn't work.

thumbnail
Cameron McBride, modificado 13 Anos atrás.

Creating My Greeting portlet tutorial doesn't work.

Expert Postagens: 269 Data de Entrada: 08/02/11 Postagens Recentes
I am following through the My Greeting portlet tutorial found here: http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/writing-the-my-greeting-portlet

What I have found is that the actionRequest variable is null in the edit.jsp file. Since that variable is null the purpose of the whole thing fails.

Just to be sure in both the edit.jsp and the view.jsp I added this up near the top:
if (actionRequest == null) { System.out.println("actionRequest is null"); }

Has something changed since the documentation was written?
Oliver Bayer, modificado 13 Anos atrás.

RE: Creating My Greeting portlet tutorial doesn't work.

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Cameron,

as Deb Troxel mentioned in the Developer Documentation Review it should be "renderRequest" instead of "actionRequest".

See the following link.

HTH Oli
thumbnail
Cameron McBride, modificado 13 Anos atrás.

RE: Creating My Greeting portlet tutorial doesn't work.

Expert Postagens: 269 Data de Entrada: 08/02/11 Postagens Recentes
Thanks for that link.

Another bug/problem in the tutorial is with the success message. When you click submit it is supposed to show the edit.jsp page again with a success message. Instead it executes the action MyGreetingPortlet.java and then shows view.jsp.

<portlet:actionurl var="editGreetingURL" name="setGreeting">
	<portlet:param name="jspPage" value="/edit.jsp" />
</portlet:actionurl>

<aui:form action="<%= editGreetingURL %>" method="post">
	<aui:input label="greeting" name="greeting" type="text" value="<%= greeting %>" />
	<aui:button type="submit" />
</aui:form>


Snippet from my portal.xml:
		<portlet-class>com.liferay.samples.MyGreetingPortlet</portlet-class>
		<init-param>
			<name>view-jsp</name>
			<value>/view.jsp</value>
		</init-param>


I don't understand why after submitting the form the view.jsp is shown instead of edit.jsp.
Hon Hwang, modificado 12 Anos atrás.

RE: Creating My Greeting portlet tutorial doesn't work.

New Member Postagens: 17 Data de Entrada: 04/07/11 Postagens Recentes
Hi,

See this thread. for details. Basically, in portlet.xml, you'll have to add this:

<init-param>
    <name>copy-request-parameters</name>
    <value>true</value>
</init-param>


even though, it is listed as a tip in the developer documentation. I encountered the same problem.

I still have no idea why this worked at the moment; searching for answers.
Nguyen Le, modificado 11 Anos atrás.

RE: Creating My Greeting portlet tutorial doesn't work.

New Member Postagens: 11 Data de Entrada: 24/04/12 Postagens Recentes
GreetingPortlet is temporarily unavailable.

Help me, please