0

I am building a form within admin of magento 2 using ui components and want to organise the fields within fieldsets like below:

<fieldset name="ticket">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Ticket</item>
        </item>
    </argument>

    <field name="ticketingo_tickets_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="visible" xsi:type="boolean">false</item>
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">ticket</item>
            </item>
        </argument>
    </field>

    <fieldset>
        <settings>
            <label translate="true">Customer Information</label>
            <collapsible>true</collapsible>
        </settings>
        <!--Fields within this nested fieldset no longer function-->
        <field name="customer_name">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string">Customer Name</item>
                    <item name="visible" xsi:type="boolean">true</item>
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">input</item>
                    <item name="source" xsi:type="string">ticket</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
            </settings>
        </field>
    </fieldset>
    ...
</fieldset>

However my form breaks as soon as I attempt to add a child fieldset to the main fieldset. Any inputs within the new fieldset values include the new fieldsets in the name and i do not really cant this. I have tried with containers to achieve similar but not much luck and really just want these collapsible fieldsets to work.

0

Adding the dataScope setting node as empty seemed to stop fieldsets from adding additional scopes to names of inputs etc and my form started working fine.

<fieldset name="ticket-issue">
        <settings>
            <label translate="true">Issue Overview</label>
            <collapsible>true</collapsible>
            <opened>true</opened>
            <!--Added Below to fieldsets-->
            <dataScope></dataScope>
        </settings>
        ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.