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

getOptions returns the selected and available values for Select fields which allows multiple values

Details

    Description

      getOptions returns the selected and available values for Select fields which allows multiple values

      Steps to reproduce:

      1. Create a Structure S1 with a multiple Select field called Sel1 with three default options
      2. Create a Template T1 with the following markup
        Selected options:
        <ul>
        <#list Sel1.getOptions() as key> 
        <li>opt: ${key} </li> 
        </#list>
        </ul>
        
        Available options:
        <ul>
        <#list Sel1.getOptionsMap() as key, value> 
        <li>opt: ${key} = ${value} </li> 
        </#list>
        </ul> 
        
      1. Create a Web Content WC1 based off of S1 selecting option 2 and option 3
      2. Configure a Web Content Display to show WC1
      3. Check the WCD's output

      Actual result:
      Selected options:

      • opt: value 2
      • opt: value 3
      • opt: value 1
      • opt: value 2
      • opt: value 3
        Available options:
      • opt: value 3 = option 3
      • opt: value 2 = option 2
      • opt: value 1 = option 1

      Expected result:
      Selected options:

      • opt: value 2
      • opt: value 3
        Available options:
      • opt: value 1 = option 1
      • opt: value 2 = option 2
      • opt: value 3 = option 3

      NOTE:

      • getOptions and getOptionsMap have different semantics, which might not be expectable due to historic reasons. See LPS-32957 for the definition of getOptionsMap and LPS-54235 to see the expected behavior for getOptions.

      Attachments

        Issue Links

          Activity

            People

              harry.chai Harry Chai
              daniel.couso Daniel Couso
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 2 weeks, 5 days ago

                Packages

                  Version Package
                  7.1.10 DXP FP21
                  7.1.X
                  7.2.10 DXP FP9
                  7.2.X
                  7.3.5 CE GA6
                  7.3.10 DXP GA1
                  7.3.X
                  Master