Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-91310

Bean portlet action methods are not invoked according to the value of the javax.portlet.action request parameter

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 7.1.0 CE GA1, 7.1.10 DXP GA1, 7.1.10 DXP FP1, 7.1.10 DXP FP2, 7.1.10 DXP FP3, 7.1.1 CE GA2, 7.1.10 DXP FP4, 7.1.10 DXP FP5, 7.1.10.1 SP1, 7.1.2 CE GA3, 7.1.10 DXP FP6, 7.1.10 DXP FP7
    • Fix Version/s: 7.1.X, Master
    • Labels:
      None

      Description

      Problem Overview

      Given the following JSPX markup and Java source, the submitForm and omniAction methods should be invoked when the "submitForm" button is clicked. Similarly, the resetForm and omniAction methods should be invoked when the "resetForm" button is clicked:

      <portlet:actionURL var="actionURL"/>
      <form action="${actionURL}" data-senna-off="true" method="post">
          <input type="submit" name="${namespace}javax.portlet.action" value="submitForm">
          <input type="submit" name="${namespace}javax.portlet.action" value="resetForm">
      </form>
      
      MyBeanPortlet.java
      public class MyBeanPortlet {
      
      	@ActionMethod(portletName = "LPS-91310")
      	public void omniAction(
      		ActionRequest actionRequest, ActionResponse actionResponse) {
      	}
      
      	@ActionMethod(portletName = "LPS-91310", actionName = "resetForm")
      	public void resetForm(
      		ActionRequest actionRequest, ActionResponse actionResponse) {
      	}
      
      	@ActionMethod(portletName = "LPS-91310", actionName = "submitForm")
      	public void submitForm(
      		ActionRequest actionRequest, ActionResponse actionResponse) {
      	}
      }
      

      The problem is that the the submitForm, resetForm, and omniAction methods are all invoked regardless of which button is clicked on.

      Steps to Reproduce

      1. Deploy the attached portlet to $LIFERAY_HOME/deploy and add the portlet named "LPS-91310" to a portal page.
      2. Click on the "submitForm" button and record the results displayed by the portlet
      3. Click on the "Try again" link
      4. Click on the "resetForm" button and record the results displayed by the portlet

      Expected Results

      When the "submitForm" button is clicked in step 2, the following is displayed:

      LPS-91310: Invoked action methods:
      	•	omniAction
      	•	submitForm
      

      Also, when the "resetForm" button is clicked in step 4, the following is displayed:

      LPS-91310: Invoked action methods:
      	•	omniAction
      	•	resetForm
      

      Actual Results

      When either button is clicked, the "omniAction" method is not invoked.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                40 weeks, 2 days ago

                Packages

                Version Package
                7.1.X
                Master