Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Cameron McBride
Creating My Greeting portlet tutorial doesn't work.
March 8, 2011 5:36 AM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

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:
1if (actionRequest == null) { System.out.println("actionRequest is null"); }

Has something changed since the documentation was written?
Oliver Bayer
RE: Creating My Greeting portlet tutorial doesn't work.
March 8, 2011 5:54 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 889

Join Date: February 18, 2009

Recent Posts

Hi Cameron,

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

See the following link.

HTH Oli
Cameron McBride
RE: Creating My Greeting portlet tutorial doesn't work.
March 8, 2011 6:35 AM
Answer

Cameron McBride

Rank: Expert

Posts: 273

Join Date: February 8, 2011

Recent Posts

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.

1<portlet:actionURL var="editGreetingURL" name="setGreeting">
2    <portlet:param name="jspPage" value="/edit.jsp" />
3</portlet:actionURL>
4
5<aui:form action="<%= editGreetingURL %>" method="post">
6    <aui:input label="greeting" name="greeting" type="text" value="<%= greeting %>" />
7    <aui:button type="submit" />
8</aui:form>


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


I don't understand why after submitting the form the view.jsp is shown instead of edit.jsp.
Hon Hwang
RE: Creating My Greeting portlet tutorial doesn't work.
July 14, 2011 5:39 PM
Answer

Hon Hwang

Rank: New Member

Posts: 17

Join Date: July 3, 2011

Recent Posts

Hi,

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

1<init-param>
2    <name>copy-request-parameters</name>
3    <value>true</value>
4</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
RE: Creating My Greeting portlet tutorial doesn't work.
May 9, 2012 7:29 AM
Answer

Nguyen Le

Rank: New Member

Posts: 11

Join Date: April 24, 2012

Recent Posts

GreetingPortlet is temporarily unavailable.

Help me, please