1

I want to add a dynamic field in my custom module, I added this mentioned code but it is not working for me. I am getting below error

{"0":"Notice: Undefined index: arguments in /home/162390.cloudwaysapps.com/atztpeuakb/public_html/vendor/magento/module-ui/Config/Data.php on line 162","1":"#0 /home/162390.cloudwaysapps.com/atztpeuakb/public_html/vendor/magento/module-ui/Config/Data.php(162):

I added full code of mine form ui_componenet. Can you help me to identify my error?

    <?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">vendordetails_data_form.vendordetails_data_form_data_source</item>
        </item>
        <item name="label" xsi:type="string" translate="true">Data Information</item>
        <item name="template" xsi:type="string">templates/form/collapsible</item>
    </argument>
    <settings>
        <buttons>
            <button name="back" class="Customform\Vendordetails\Block\Adminhtml\Data\Edit\Buttons\Back" />
            <button name="delete" class="Customform\Vendordetails\Block\Adminhtml\Data\Edit\Buttons\Delete" />
            <button name="reset" class="Customform\Vendordetails\Block\Adminhtml\Data\Edit\Buttons\Reset" />
            <button name="save" class="Customform\Vendordetails\Block\Adminhtml\Data\Edit\Buttons\Save" />
            <button name="save_and_continue" class="Customform\Vendordetails\Block\Adminhtml\Data\Edit\Buttons\SaveAndContinue" />
        </buttons>
        <namespace>vendordetails_form</namespace>
        <dataScope>data</dataScope>
        <deps>
            <dep>vendordetails_data_form.vendordetails_data_form_data_source</dep>
        </deps>
    </settings>
    <dataSource name="vendordetails_data_form_data_source">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/form/provider</item>
            </item>
        </argument>
        <settings>
            <submitUrl path="vendordetails/data/save"/>
        </settings>
        <dataProvider class="Customform\Vendordetails\Model\DataProvider" name="vendordetails_data_form_data_source">
            <settings>
                <requestFieldName>data_id</requestFieldName>
                <primaryFieldName>data_id</primaryFieldName>
            </settings>
        </dataProvider>
    </dataSource>



    <fieldset name="data_details">
        <settings>
            <label/>
        </settings>




    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Fieldset label goes here</item>
            <item name="sortOrder" xsi:type="number">10</item>
        </item>
    </argument>
    <container name="give_it_a)unique_name">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/dynamic-rows/dynamic-rows</item>
                <item name="template" xsi:type="string">Magento_Backend/dynamic-rows/grid</item>
                <item name="componentType" xsi:type="string">dynamicRows</item>
                <item name="recordTemplate" xsi:type="string">record</item>
                <item name="deleteButtonLabel" xsi:type="string">Remove</item>
                <item name="addButtonLabel" xsi:type="string">Add New </item>
                <item name="deleteProperty" xsi:type="boolean">false</item>
                <item name="dndConfig" xsi:type="array">
                    <item name="enabled" xsi:type="boolean">false</item>
                </item>
            </item>
        </argument>
        <container name="record">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Record label goes here</item>
                    <item name="component" xsi:type="string" translate="true">Magento_Ui/js/dynamic-rows/record</item>
                    <item name="isTemplate" xsi:type="boolean">true</item>
                    <item name="is_collection" xsi:type="boolean">true</item>
                    <item name="showFallbackReset" xsi:type="boolean">false</item>
                </item>
            </argument>
            <field name="first_field_here">

            </field> 

            <actionDelete>
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="componentType" xsi:type="string">actionDelete</item>
                        <item name="dataType" xsi:type="string">text</item>
                        <item name="fit" xsi:type="boolean">false</item>
                        <item name="label" xsi:type="string">Actions</item>
                        <item name="sortOrder" xsi:type="string">100</item>
                        <item name="additionalClasses" xsi:type="string">data-grid-actions-cell</item>
                        <item name="template" xsi:type="string">Magento_Backend/dynamic-rows/cells/action-delete</item>
                    </item>
                </argument>
            </actionDelete>
        </container>
    </container>




        <field name="data_id" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">data</item>
                </item>
            </argument>
            <settings>
                <dataType>text</dataType>
                <visible>false</visible>
                <dataScope>data_id</dataScope>
            </settings>
        </field>
        <field name="data_name" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">data</item>
                </item>
            </argument>
             <item name="sortOrder" xsi:type="number">10</item>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Vendor Name</label>
                <dataScope>data_name</dataScope>
            </settings>
        </field>
        <field name="data_email" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">data</item>
                </item>
                <item name="sortOrder" xsi:type="number">20</item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <dataType>text</dataType>
                <label translate="true">Vendor Email</label>
                <dataScope>data_email</dataScope>
            </settings>
        </field>
        <field name="data_service">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Customform\Vendordetails\Model\DetailsCollection\Service</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Vendor Service List</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">data_service</item>
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">30</item>
                    <item name="listens" xsi:type="array">
                        <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">conditions</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>  
        <field name="data_typeservice">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Customform\Vendordetails\Model\DetailsCollection\Servicetype</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Vendor Service Type</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">data_typeservice</item>
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">40</item>
                    <item name="listens" xsi:type="array">
                        <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">conditions</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="data_city">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Customform\Vendordetails\Model\DetailsCollection\City</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Vendor City</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">data_city</item>
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                    <item name="listens" xsi:type="array">
                        <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">conditions</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="data_location">
            <argument name="data" xsi:type="array">
                <item name="options" xsi:type="object">Customform\Vendordetails\Model\DetailsCollection\Location</item>
                <item name="config" xsi:type="array">
                    <item name="label" xsi:type="string" translate="true">Vendor Location</item>
                    <item name="componentType" xsi:type="string">field</item>
                    <item name="formElement" xsi:type="string">select</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                    <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    <item name="dataScope" xsi:type="string">data_location</item>
                    <item name="filterOptions" xsi:type="boolean">true</item>
                    <item name="showCheckbox" xsi:type="boolean">true</item>
                    <item name="chipsEnabled" xsi:type="boolean">true</item>
                    <item name="disableLabel" xsi:type="boolean">true</item>
                    <item name="multiple" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">60</item>
                    <item name="listens" xsi:type="array">
                        <item name="newOption" xsi:type="string">toggleOptionSelected</item>
                    </item>
                    <item name="required" xsi:type="boolean">true</item>
                    <item name="source" xsi:type="string">conditions</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
        </field>
        <field name="data_description" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/textarea</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/textarea</item>
                    <item name="source" xsi:type="string">data</item>
                </item>
                <item name="sortOrder" xsi:type="number">70</item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <dataType>textarea</dataType>
                <label translate="true">Vendor Job Description</label>
                <dataScope>data_description</dataScope>
            </settings>
        </field>
        <field name="data_time" formElement="input">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Ui/js/form/element/textarea</item>
                    <item name="elementTmpl" xsi:type="string">ui/form/element/textarea</item>
                    <item name="source" xsi:type="string">data</item>
                </item>
                <item name="sortOrder" xsi:type="number">80</item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">true</rule>
                </validation>
                <dataType>textarea</dataType>
                <label translate="true">Vendor Available Time</label>
                <dataScope>data_time</dataScope>
            </settings>
        </field>
    </fieldset>
</form>
  • try after remove <field name="first_field_here"> </field> this code and correct name from give_it_a)unique_name to give_it_a_unique_name – kunj Jul 13 '18 at 11:40

Your Answer

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

Browse other questions tagged or ask your own question.