Announcement Announcement Module
No announcement yet.
Missing request Parameter in SimpleFormController Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing request Parameter in SimpleFormController

    Liferay 5.1
    Spring portlet-mvc

    Here's the problem:

    I have a SimpleFormController that is navigated to from the following code fragment:

    <portlet:renderURL var="actionUrl">
    	<portlet:param name="action" value="addGroup"/>
    	<portlet:param name="groupId" value="${linkGroup.key}"/>
    The SimpleFormController then adds the groupId to the model in the referenceData method like so:

    Map<String, String> refData = new HashMap<String, String>();
    		refData.put("groupId", request.getParameter("groupId"));
    This works fine, and is then available to me in page.

    I then submit the from, but have a validator for it, the validator picks up the errors in the form, and then recalls the referenceData method before it reloads the page, but this time the groupId variable is not available!

    If the form submits successfully then the group parameter is available in the onSubmitAction which is where I need it!

    I know I could make the groupId part of the form, and this would then overcome my problem, but this parameter, doesn't really belong in my bean...

    Maybe I am missing something to do with the lifecycle of the SimpleFormController, if anyone knows of a lifecycle diagram, documentation:stat transition diagram that explains this that might be useful...

    I really appreciate any help that can be offered on this

    Last edited by ma_crice; Feb 14th, 2009, 10:02 AM. Reason: forgot important framework info