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

setting <aui:select /> as required should always show required label

    Details

      Description

      Setting <aui:select /> as required should always show the required label whether the rule is set as an attribute on the select taglib or as a validator rule in the embedded <aui:validator />. The behavior should be similar to how <aui:input /> acts. Right now, only adding the required attribute on <aui:select /> will display the "required" label, but not when the rule is added via <aui:validator />

      To reproduce:
      1) Add the following test conditions in:
      docroot/html/portlet/breadcrumb/view.jsp (6.2)
      modules/apps/web-experience/site-navigation/site-navigation-breadcrumb-web/src/main/resources/META-INF/resources/view.jsp (7.0)

      <aui:form method="post" name="fmr1">
          <aui:select name="sampleDropdown1" label="Required Attribute" required="<%= true %>">
              <aui:option selected="true" value="">Select an Option</aui:option>
              <aui:option value="1">Option 1</aui:option>
              <aui:option value="2">Option 2</aui:option>
          </aui:select>
      
          <aui:select name="sampleDropdown2" label="Required Validator Rule">
              <aui:option selected="true" value="">Select an Option</aui:option>
              <aui:option value="1">Option 1</aui:option>
              <aui:option value="2">Option 2</aui:option>
      
              <aui:validator name="required" />
          </aui:select>
      
          <aui:input name="sampleInput" label="Required Attribute" required="true" type="text" />
      
          <aui:input name="sampleInput2" label="Required Validator Rule" type="text">
              <aui:validator errorMessage="you-must-specify-a-file-or-a-title" name="required" />
          </aui:input>
      
          <aui:button value="Save" type="submit"></aui:button>
      </aui:form>
      

      2) Redeploy the appropriate portlet or module
      3) Place it on a page

      Expected Behavior:
      The "required" label should be displayed for every required field.

      Actual Behavior:
      The "required" label only shows when the rule is set as an attribute on the select taglib.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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

                  Packages

                  Version Package
                  7.0.0 DXP FP43
                  7.0.6 CE GA7
                  7.0.0 DXP SP8
                  7.0.X
                  7.1.0 M1
                  7.1.X
                  Master