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

Cannot retrieve list of options from Freemarker

    Details

      Description

      Issue
      getOptions method returns nothing so cannot retrieve list of options from Freemarker.

      Steps to reproduce

      1. Start a clean bundle
      2. Create a new Web Content structure with just one Select field, all with default options
      3. Create a new Template for that structure (change the variable name accordingly)
        Selected value:<br />
        ${Select1vi7.getData()}<br />
        <br />
        Size of getOptionsMap:<br />
        ${Select1vi7.getOptionsMap()?size}<br />
        Size of getOptions:<br />
        ${Select1vi7.getOptions()?size}<br />
        <br />
        List of getOptionsMap?keys: <br />
        <#list Select1vi7.getOptionsMap()?keys as key>
          ${key}<br />
        </#list>
        <br />
        List of getOptions:<br />
        <#list Select1vi7.getOptions() as item>
          ${item}<br />
        </#list>
      4. Create a new Web Content based on that structure
      5. Preview the content or display it in a site page

      Actual results
      getOptions do not return any value

      Expected results
      getOptions returns the 3 different options like getOptionsMap does (without the keys)

      Reproduced in
      7.1.x (c2f3fa7c9792fccae210b9cf7966277bd0b302cf)
      master (0a9d8a4cef3087e830a086d8f30176c27981f37b)

      Note
      Definition of the object:
      https://docs.liferay.com/portal/7.1-latest/javadocs/portal-kernel/com/liferay/portal/kernel/templateparser/TemplateNode.html

      * Please see Zendesk Support tab for further comments and attachments.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chao.wang Chao Wang
              Reporter:
              hong.vo Hong Vo
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Engineering Assignee:
              Hong Vo
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                42 weeks ago

                  Packages

                  Version Package
                  7.1.10 DXP FP19
                  7.1.10.5 SP5
                  7.1.X
                  7.2.10 DXP FP7
                  7.2.X
                  7.3.4 CE GA5
                  7.3.10 DXP GA1
                  Master