• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

liferay portlet - form parameters missing from request

 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is a form I have in a liferay portlet. Shown are the different ways I've tried to pass parameters that need to be handled by the portlet.


none of the variables show up in the portlet that handles this form. According the portlet specification, the form should trigger the portlet's processAction() method, but it does not. this form goes to the doView() method without its parameters.

I looked at the source generated for my form's action and it has a url that would otherwise work as intended in my portlet.

Based on this thread from the liferay forums, I seem to have everything set properly. What am I missing?
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
method must be post, apparently.

The following form did call processAction and delivered its form parameters.



note also that processAction can call actionRequest.setRenderParam(String,String) to send parameters back to the doView method
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


It is best practice to use <portlet:namespace/> tag before the form name. This tag generates unique namespace for every portlet, so that naming conflicts won't occur even multiple portlets in a page have same form name.

Below code will be sollution to your problem. <portlet:actionURL > will invoke processAction() method of same portlet. So you can write your required logic in the processAction() method. Using render you can redirect to required page or jsp.

<form action="<portlet:actionURL ><portlet:param name="action" value="editStocks"/></portlet:actionURL>" method="POST" name ="<portlet:namespace/>fm">

You can also send parameters using <portlet:param> tag.
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic