I want to write a custom module to export product data and I have a problem with a custom admin form using ui components. It will only have one simple select input with stores id and export button and here is the problem. I don't know how to use the button to submit this form. I'm following the Magento 2 docs, but don't know what to put in the element called "targetName". I tried write something like this, but without success:

<item name="targetName" xsi:type="string">my_ui_component_filename.my_ui_component_filename</item>

When I write this I get an error in the console after I click the button: enter image description here

My entire code for the button from the ui component .xml file:

<button name="export_button">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="actions" xsi:type="array">
                    <item name="0" xsi:type="array">
                        <item name="targetName" xsi:type="string">productimportexport_importexport_form.productimportexport_importexport_form</item>
                        <item name="actionName" xsi:type="string">export</item>
            <title translate="true">Export</title>

I'm working on Magento 2.4.4. Can anyone help me? I searched google for a few hours but couldn't find the answer to my question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.