Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Cameron McBride
Creating My Greeting portlet tutorial doesn't work.
8 de Março de 2011 05:36
Resposta

Cameron McBride

Ranking: Expert

Mensagens: 273

Data de entrada: 8 de Fevereiro de 2011

Mensagens 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:
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.
8 de Março de 2011 05:54
Resposta

Oliver Bayer

Ranking: Liferay Master

Mensagens: 889

Data de entrada: 18 de Fevereiro de 2009

Mensagens 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
Cameron McBride
RE: Creating My Greeting portlet tutorial doesn't work.
8 de Março de 2011 06:35
Resposta

Cameron McBride

Ranking: Expert

Mensagens: 273

Data de entrada: 8 de Fevereiro de 2011

Mensagens 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.

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.
14 de Julho de 2011 17:39
Resposta

Hon Hwang

Ranking: New Member

Mensagens: 17

Data de entrada: 3 de Julho de 2011

Mensagens recentes

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.
9 de Maio de 2012 07:29
Resposta

Nguyen Le

Ranking: New Member

Mensagens: 11

Data de entrada: 24 de Abril de 2012

Mensagens recentes

GreetingPortlet is temporarily unavailable.

Help me, please