I have created a module with a nested subform in the XML config.
When a new row of the subform is added, a JS error is displayed in the console. A line is added. When saving the module, another empty row is added.
My nested-subform for test in the config xml
<fieldset name="test_subform">
<field
name="mysubform"
type="subform"
label="My Subform"
description="Subform Field Description"
layout="joomla.form.field.subform.repeatable"
multiple="true"
>
<form>
<field
name="special_day"
type="calendar"
filter="server_utc"
class="input-small"
showtime="false"
translateformat="true"
label="SELECT_DATE"
description=""
required="true"
/>
<field
name="is_open"
type="radio"
filter="integer"
class="btn-group btn-group-yesno"
default="1"
label="open/close"
>
<option value="0">CLOSE</option>
<option value="1">OPEN</option>
</field>
<field
name="times"
type="subform"
label="times"
showon="is_open:1"
layout="joomla.form.field.subform.repeatable-table"
>
<form>
<field name="time1_from" type="text" default="09:00" size="10" maxlength="7" label="TIME_1_FROM" />
<field name="time1_to" type="text" default="18:00" size="10" maxlength="7" label="TIME_1_TO" />
<field name="time2_from" type="text" size="10" maxlength="7" label="TIME_2_FROM" />
<field name="time2_to" type="text" size="10" maxlength="7" label="TIME_2_TO" />
</form>
</field>
</form>
</field>
</fieldset>
JS Error:
Uncaught Error: The row template is required for the subform element to work
Joomla 4.4.0.
PHP: 8.1
I have found older, already closed Issius on the same topic:
Labels |
Added:
No Code Attached Yet
|
Labels |
Added:
bug
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-12-02 08:49:05 |
Closed_By | ⇒ | Fedik |
Okay, it not a bug, you forgot multiple="true"
for your field name="times"
It something to do with
layout="joomla.form.field.subform.repeatable-table"
for nested subform.For now you can use the default "non table" layout, it works with it.