J4 Issue ?
avatar ReLater
ReLater
27 Oct 2020

Steps to reproduce the issue

  • In Joomla 3 add or change a field of type="templatestyle" with multiple="true" like this:
<field name="whateverName" type="templatestyle" default=""
 label="Select whatever"
 multiple="true"
 description="">
</field>
  • You get automatically a "chosened" field

27-10-_2020_15-25-10

  • In Joomla 4 add or change a field of type="templatestyle" with multiple="true" like this. Don't forget the layout attribute that works as expected wit list fields:
<field name="whateverName" type="templatestyle" default=""
 label="Select whatever"
 multiple="true"
 layout="joomla.form.field.list-fancy-select"
 description="">
</field>
  • Field doesn't use the fancy-select feature. Multi selection needs STRG.

27-10-_2020_15-25-43

Expected result

  • Joomla 4 field should use fancy-select feature.
avatar ReLater ReLater - open - 27 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 27 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Oct 2020
avatar Harmageddon
Harmageddon - comment - 27 Oct 2020

The problem seems to be that the GroupedlistField is not organized and split into layouts, but rather hardcoded in the field class. So the layout can't be easily overridden with the fancy-select alternative.
For cleaner code and consistency with most other fields, the best solution would be to change the GroupedlistField implementation to a layout-based one. This needs some digging into the code, as there is hardcoded HTML in several places inside the class.

But for the problem described here (how to make multi-select grouped lists fancier), maybe somebody knows another solution based on CSS classes or JS behaviour?

avatar jwaisner jwaisner - change - 2 Nov 2020
Labels Added: J4 Issue
avatar jwaisner jwaisner - labeled - 2 Nov 2020
avatar Fedik
Fedik - comment - 19 Apr 2021

To fix this issue need to move GroupedlistField::getInput() to layout as it done for ListField::getInput()
and create 2 layouts
joomla.form.field.groupedlist - default
joomla.form.field.groupedlist-fancy-select - optional

Anyone brave here? :)

avatar Fedik Fedik - change - 22 May 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-05-22 06:46:02
Closed_By Fedik
avatar Fedik Fedik - close - 22 May 2021
avatar Fedik
Fedik - comment - 22 May 2021

Please test #34091

Add a Comment

Login with GitHub to post a comment