Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Preserve selection order in API for "Select from List" field
In Web Content Structures, when using a "Select from List" field with multiple selection enabled, the UI allows users to visually reorder selected items. However, the current behavior does not preserve this order when retrieving the values via API.
This is particularly problematic when editors rely on the selection order to define the display or processing logic downstream. For example, in our case, the selection order (e.g., priority_per_price, date_rt, product_name, priority, price_desc, price_asc) was meaningful and used in production systems to drive sorting behavior.
We have confirmed that in Liferay 7.4 q1.0 2025, the order is not preserved and appears to be stored arbitrarily, which breaks the expected functionality after recent upgrades. The visual reordering in the UI is not reflected in the actual stored data or API response.
This behavior causes confusion and breaks backward compatibility in environments where selection order has functional implications.
We suggest either:
- Persisting the selection order as defined by
the user in the API.
- Or, at least, allowing the configuration of
this behavior per field or structure.
This feature would improve consistency and data reliability for use cases where selection order matters.