[Beta] Backend filter dropdowns still using chozen instead of core. #1026

Closed
opened 2024-01-19 19:00:54 +00:00 by Tom van der Laan · 8 comments

Steps to reproduce the issue

Install component, view backend list view. Notice the dropdowns are not core.

Expected result

Dropdowns using core.

Actual result

Dropdowns generated using chozen JS.

Removing chosenjs markup and removing display:none on the original select already makes it look exactly like core.

System information (as much as possible)

  • PHP Version: 8.0.12
  • Joomla Version: 4.4.2
  • JCB Version: 3.1.31
### Steps to reproduce the issue Install component, view backend list view. Notice the dropdowns are not core. ### Expected result Dropdowns using core. ### Actual result Dropdowns generated using chozen JS. Removing chosenjs markup and removing display:none on the original select already makes it look exactly like core. ### System information (as much as possible) - PHP Version: 8.0.12 - Joomla Version: 4.4.2 - JCB Version: 3.1.31
Tom van der Laan added the
Beta
label 2024-01-19 19:00:54 +00:00
Author
Member

The same goes for a (custom) list type fields in single view.

The same goes for a (custom) list type fields in single view.
Llewellyn changed title from Backend filter dropdowns still using chozen instead of core. to [Beta] Backend filter dropdowns still using chozen instead of core. 2024-01-19 19:05:10 +00:00
Owner

Thanks Tom, I also noticed this... did not get to fix that as yet. You can help me if you can give me the code to change in the component with file names and lines? as much details as you can... (not from the GUI) but from the code, inside the Joomla package that JCB is building. So I can look at what the compiler must do different.

Thanks Tom, I also noticed this... did not get to fix that as yet. You can help me if you can give me the code to change in the component with file names and lines? as much details as you can... (not from the GUI) but from the code, inside the Joomla package that JCB is building. So I can look at what the compiler must do different.
Owner

The last update should fix this: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/v3.1.32.zip

Please confirm, and then closing the issue if fixed, thanks!

The last update should fix this: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/v3.1.32.zip Please confirm, and then closing the issue if fixed, thanks!
Author
Member

This was not fully working as expected. I noticed the dropdown for accesslevel type field was not using the new field option: layout="joomla.form.field.list-fancy-select". I also did not notice any difference when removing the class="multipleAccessLevels". It still showed exactly like the core field in joomla.

So basically in J4/5 you could just replace the class="multipleAccessLevels" with layout="joomla.form.field.list-fancy-select"

<field
		type="accesslevel"
		name="access"
		label="JFIELD_ACCESS_LABEL"
		description="JFIELD_ACCESS_DESC"
		multiple="true"
		layout="joomla.form.field.list-fancy-select"
		onchange="this.form.submit();"
	/>

	<field
		type="accesslevel"
		name="access"
		label="JFIELD_ACCESS_LABEL"
		description="JFIELD_ACCESS_DESC"
		multiple="true"
		layout="joomla.form.field.list-fancy-select"
	/>

I'm yet to test this on a custom field type. Will do this next.

This was not fully working as expected. I noticed the dropdown for accesslevel type field was not using the new field option: layout="joomla.form.field.list-fancy-select". I also did not notice any difference when removing the class="multipleAccessLevels". It still showed exactly like the core field in joomla. So basically in J4/5 you could just replace the class="multipleAccessLevels" with layout="joomla.form.field.list-fancy-select" <field type="accesslevel" name="access" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" multiple="true" layout="joomla.form.field.list-fancy-select" onchange="this.form.submit();" /> <field type="accesslevel" name="access" label="JFIELD_ACCESS_LABEL" description="JFIELD_ACCESS_DESC" multiple="true" layout="joomla.form.field.list-fancy-select" /> I'm yet to test this on a custom field type. Will do this next.
Author
Member

Ok for a custom field type it seems it needs two changes:

The default options needs to be removed since it is adding an option to the list that should not be there.
And it needs the above layout="joomla.form.field.list-fancy-select" added to a custom field.

I had a custom field and i changed in administrator/components/com_component/src/Field/CustomFieldfiltertypeField.php

on line 59 i uncommented this code to remove the placeholder as an select option:

	$_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_IOMCONNECT_FILTER_SELECT_COUPON_TYPE') . ' -');

BEFORE CHANGING LINE 59
Scherm­afbeelding 2024-01-22 om 22.19.55.png
Scherm­afbeelding 2024-01-22 om 22.20.01.png

AFTER CHANGING LINE 59
Scherm­afbeelding 2024-01-22 om 22.19.31.png
Scherm­afbeelding 2024-01-22 om 22.19.35.png

Ok for a custom field type it seems it needs two changes: The default options needs to be removed since it is adding an option to the list that should not be there. And it needs the above layout="joomla.form.field.list-fancy-select" added to a custom field. I had a custom field and i changed in administrator/components/com_component/src/Field/CustomFieldfiltertypeField.php on line 59 i uncommented this code to remove the placeholder as an select option: $_filter[] = Html::_('select.option', '', '- ' . Text::_('COM_IOMCONNECT_FILTER_SELECT_COUPON_TYPE') . ' -'); **BEFORE CHANGING LINE 59** ![Scherm­afbeelding 2024-01-22 om 22.19.55.png](/attachments/597664f5-045e-4713-be67-ec2f858e27fd) ![Scherm­afbeelding 2024-01-22 om 22.20.01.png](/attachments/7aee33fd-1411-424a-ac8d-1aff0505e75d) **AFTER CHANGING LINE 59** ![Scherm­afbeelding 2024-01-22 om 22.19.31.png](/attachments/e2b487d6-2d62-4955-9388-1d82ebc96643) ![Scherm­afbeelding 2024-01-22 om 22.19.35.png](/attachments/aacf539f-8191-441d-9523-d1d54633a387)
Author
Member

You would want to add this to have a good placeholder:

		hint="Type or select access"

Scherm­afbeelding 2024-01-22 om 22.31.28.png

You would want to add this to have a good placeholder: hint="Type or select access" ![Scherm­afbeelding 2024-01-22 om 22.31.28.png](/attachments/21db08d9-d8b3-418f-b3c9-f4710078a435)
Owner

The last update should fix this: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/v3.1.33.zip

Please confirm, and then closing the issue if fixed, thanks!

The last update should fix this: https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/v3.1.33.zip Please confirm, and then closing the issue if fixed, thanks!
Author
Member

This seems fixed indeed. I do see you're using the single select way of writing the text description for the dropdown. Will make it fit better but it's not exactly how core does it. But then i guess core is not being consistent here haha.

This seems fixed indeed. I do see you're using the single select way of writing the text description for the dropdown. Will make it fit better but it's not exactly how core does it. But then i guess core is not being consistent here haha.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joomla/Component-Builder#1026
No description provided.