Foros de discusión

Creating My Greeting portlet tutorial doesn't work.

thumbnail
Cameron McBride, modificado hace 13 años.

Creating My Greeting portlet tutorial doesn't work.

Expert Mensajes: 269 Fecha de incorporación: 8/02/11 Mensajes recientes
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 hace 13 años.

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

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
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 hace 13 años.

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

Expert Mensajes: 269 Fecha de incorporación: 8/02/11 Mensajes recientes
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 hace 12 años.

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

New Member Mensajes: 17 Fecha de incorporación: 4/07/11 Mensajes recientes
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 hace 11 años.

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

New Member Mensajes: 11 Fecha de incorporación: 24/04/12 Mensajes recientes
GreetingPortlet is temporarily unavailable.

Help me, please