Legacy Knowledge Base
Published Jul. 2, 2025

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

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

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

  • Steps to reproduce:

    • Create a Structure S1 with a multiple Select field called Sel1 with three default optionsS1_Structure.png

    • Create a Template T1 with the following markupT1_template.png
    • 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>
    • Create a Web Content WC1 based on S1 selecting option 2 and option 3
    • Configure a Web Content Display to show WC1
    • Check the WCD's output
      • Observed Result Observed_Results.png
      • Expected Result Expected_Result.png
  1.  

 Environment

  • Liferay DXP 7.2 Fix Pack 7

 Resolution

  • It's a known issue and resolved in Liferay DXP 7.2 FP9.
  • If the hotfix is required for this issue, please create a support ticket requesting the hotfix by attaching the patch details.
  • Installing Fix Packs and Hotfixes on Liferay DXP will guide to install this hotfix in the respective environment.
Did this article resolve your issue ?

Legacy Knowledge Base