• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic