Hello
i am testing subform + showone feature of joomla 4.3
i works in subform > suform > field
if we use class="btn-group"
in 2sc level of subform radio form is broken
if i don't use css class radio field is usuable and showone works
=> i didn't see any js error in my browser
my original code
<?xml version="1.0" encoding="UTF-8"?>
<form>
<field name="displayButtonTypeOption" label="Type of button" description="MOD_DASHBOARD_DISPLAY_LINE_DESC" type="radio" default="0" class="btn btn-group">
<option value="1">Add item</option>
<option value="2">Edit item</option>
<option value="3">Link to categorie</option>
<option value="4">Custom button</option>
</field>
<!--Add item -->
<field name="button_name" label="MOD_DASHBOARD_NAME_BUTTON" description="MOD_DASHBOARD_NAME_BUTTON_DESC" size="30" type="text"/>
<field name="catid" type="category" extension="com_content" multiple="false" label="MOD_DASHBOARD_CAT" description="MOD_DASHBOARD_CAT_DESC" showon="displayButtonTypeOption:1" />
<!--Edit item -->
<field name="nameitemedit" type="text" label="MOD_DASHBOARD_NAME_BUTTON" description="MOD_DASHBOARD_NAME_BUTTON_DESC" showon="displayButtonTypeOption:2"/>
<field name="itemid" type="text" size="5" label="MOD_DASHBOARD_ITEM" description="MOD_DASHBOARD_ITEM_DESC" showon="displayButtonTypeOption:2"/>
<!--Link to categorie-->
<field name="namecatfilter" type="text" label="MOD_DASHBOARD_NAME_BUTTON" description="MOD_DASHBOARD_NAME_BUTTON_DESC" showon="displayButtonTypeOption:3"/>
<field name="catidlist" type="category" extension="com_content" multiple="false" label="MOD_DASHBOARD_CAT" description="MOD_DASHBOARD_CAT_DESC" showon="displayButtonTypeOption:3" />
<field name="displayauthoronly" label="MOD_DASHBOARD_DISPLAY_AUTHOR_ONLY" description="MOD_DASHBOARD_DISPLAY_AUTHOR_ONLY_DESC" type="radio" default="0" layout="joomla.form.field.radio.switcher" showon="displayButtonTypeOption:3">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<!--Free button-->
<field name="linkbutton" type="text" label="MOD_DASHBOARD_FREE_LINK" description="MOD_DASHBOARD_FREE_LINK_DESC" showon="displayButtonTypeOption:4" />
<!--common option-->
<field name="iconbutton" type="iconpicker" default="" label="MOD_DASHBOARD_ICON" description="MOD_DASHBOARD_ICON_DESC" />
<field name="coloricon" type="color" default="" format="rgba" label="MOD_DASHBOARD_ICON_COLOR" description="MOD_DASHBOARD_ICON_COLOR_DESC"/>
<field name="button_lang" type="contentlanguage" label="MOD_DASHBOARD_LANG" description="MOD_DASHBOARD_LANG_DESC" class="span12 small">
<option value="*">JALL</option>
</field>
<field name="targetlink" label="MOD_DASHBOARD_TARGETLINK" description="MOD_DASHBOARD_TARGETLINK_DESC" type="radio" default="_self" class="btn btn-group btn-yes-no">
<option value="_self">MOD_DASHBOARD_SELF</option>
<option value="_blank">MOD_DASHBOARD_BLANK</option>
</field>
<field name="displayline" label="MOD_DASHBOARD_DISPLAY_LINE" description="MOD_DASHBOARD_DISPLAY_LINE_DESC" type="radio" default="0" layout="joomla.form.field.radio.switcher">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</form>
thanks for any help or return
Labels |
Added:
No Code Attached Yet
|
Hope that helps :-)
@obuisard i know that but my return isn't about this ... radio works but not class its a bug not ? using select only for 4 items isn't a good ux solution in this case. Error is same if you want to add a radio button only with 2 values (but no switcher because isn't yes/no question)
Are there any javascript errors in the console?
no, nothing
i test same subform code not in existing subform (root) that works
problem seems appair in subform of subform
I have seen it being a challenge to have stylings and showon script work properly in subforms. We may still have issues with subforms of subforms...
Labels |
Added:
bug
|
Labels |
Added:
PBF
|
Labels |
Removed:
PBF
|
Is there any solution for this bug? Radio buttons are not active/selectable in repeatable subforms.
still nothing?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-06-15 15:08:16 |
Closed_By | ⇒ | Fedik |
In Joomla 4, you should use layout="joomla.form.field.radio.switcher" rather than class="btn-group" for fields having 0/1 values. If you have more than 2 values, you should use type 'list' rather than 'radio'.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40160.