Forums de discussion

Creating My Greeting portlet tutorial doesn't work.

thumbnail
Cameron McBride, modifié il y a 13 années.

Creating My Greeting portlet tutorial doesn't work.

Expert Publications: 269 Date d'inscription: 08/02/11 Publications récentes
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, modifié il y a 13 années.

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

Liferay Master Publications: 894 Date d'inscription: 18/02/09 Publications récentes
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, modifié il y a 13 années.

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

Expert Publications: 269 Date d'inscription: 08/02/11 Publications récentes
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, modifié il y a 12 années.

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

New Member Publications: 17 Date d'inscription: 04/07/11 Publications récentes
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, modifié il y a 11 années.

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

New Member Publications: 11 Date d'inscription: 24/04/12 Publications récentes
GreetingPortlet is temporarily unavailable.

Help me, please