{"id":369368,"date":"2023-03-29T12:27:58","date_gmt":"2023-03-29T12:27:58","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=369368"},"modified":"2024-05-23T13:08:02","modified_gmt":"2024-05-23T13:08:02","slug":"open-ui-form-in-modal-popup-in-adobe-commerce","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/","title":{"rendered":"Open UI Form In Modal PopUp In Adobe Commerce"},"content":{"rendered":"\n<p>In this blog, we will see how to create an Ui form in a modal pop-up in adobe commerce.<br>Yes, like admin grid, we can also create forms using the Ui component and open that form in a modal popup through the Ui component.<\/p>\n\n\n\n<p>Before we will use the tempate and jQuery for creating modal pop-up in the grid but as per the adobe commerce standards we have to use Ui component modal for the grid actions where we do not have to redirect a page and it will works on the same page.<\/p>\n\n\n\n<p>Suppose we want to create an employee add\/edit form in the admin with a grid. If you use Ui form in a modal popup you don&#8217;t need to create a new layout or page you can add or edit on the same page itself. Also, the grid data will refresh without page loading when you edit any data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Now follow the steps to create a UI form in the modal popup.<\/strong><\/h2>\n\n\n\n<p><strong>1:-<\/strong> <a href=\"https:\/\/webkul.com\/blog\/create-hello-module-in-magento2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Create a new module<\/a>.<\/p>\n\n\n\n<p><strong>2:-<\/strong> First, you have to create a router for the controller. Create \u2018routes.xml\u2019 in folder \u2018Webkul\/UiForm\/etc\/adminhtml\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:App\/etc\/routes.xsd&quot;&gt;\n    &lt;router id=&quot;admin&quot;&gt;\n        &lt;route id=&quot;uiform&quot; frontName=&quot;uiform&quot;&gt;\n            &lt;module name=&quot;Webkul_UiForm&quot;\/&gt;\n        &lt;\/route&gt;\n    &lt;\/router&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<p><strong>3:<\/strong>&#8211; Now create a controller. Create an \u2018Edit.php\u2019 \u00a0in the folder \u2018Webkul\/UiForm\/Controller\/Adminhtml\/Employee\u2019.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\UiForm\\Controller\\Adminhtml\\Employee;\n\nuse Magento\\Framework\\Controller\\ResultFactory;\n\nclass Edit extends \\Magento\\Backend\\App\\Action\n{\n    \/**\n     * @return \\Magento\\Backend\\Model\\View\\Result\\Page\n     *\/\n    public function execute()\n    {\n        $resultPage = $this-&gt;resultFactory-&gt;create(ResultFactory::TYPE_PAGE);\n        return $resultPage;\n    }\n}<\/pre>\n\n\n\n<p><strong>4:- <\/strong>Second, add the  \u2018uiform_employee_edit.xml\u2019 file in folder \u2018Webkul\/UiForm\/view\/adminhtml\/layout\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;page xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:View\/Layout\/etc\/page_configuration.xsd&quot;&gt;\n    &lt;update handle=&quot;styles&quot;\/&gt;\n    &lt;body&gt;\n        &lt;referenceContainer name=&quot;content&quot;&gt;\n            &lt;uiComponent name=&quot;employee_manage_form&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<p><strong>5:-<\/strong>  Add the  \u2019employee_manage_form.xml\u2019 form file in folder \u2018Webkul\/UiForm\/view\/adminhtml\/ui_component\u2019.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;form xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n        &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;provider&quot; xsi:type=&quot;string&quot;&gt;employee_manage_form.employee_manage_form_data_source&lt;\/item&gt;\n        &lt;\/item&gt;\n        &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Employee&lt;\/item&gt;\n        &lt;item name=&quot;reverseMetadataMerge&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/item&gt;\n    &lt;\/argument&gt;\n\n    &lt;settings&gt;\n        &lt;layout&gt;\n            &lt;navContainerName&gt;left&lt;\/navContainerName&gt;\n            &lt;type&gt;tabs&lt;\/type&gt;\n        &lt;\/layout&gt;\n        &lt;deps&gt;\n            &lt;dep&gt;employee_manage_form.employee_manage_form_data_source&lt;\/dep&gt;\n        &lt;\/deps&gt;\n    &lt;\/settings&gt;\n\n    &lt;dataSource name=&quot;employee_manage_form_data_source&quot;&gt;\n        &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Magento_Ui\/js\/form\/provider&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n        &lt;dataProvider class=&quot;Webkul\\UiForm\\Ui\\DataProvider\\Employee&quot; name=&quot;employee_manage_form_data_source&quot;&gt;\n            &lt;settings&gt;\n                &lt;requestFieldName&gt;id&lt;\/requestFieldName&gt;\n                &lt;primaryFieldName&gt;entity_id&lt;\/primaryFieldName&gt;\n            &lt;\/settings&gt;\n        &lt;\/dataProvider&gt;\n    &lt;\/dataSource&gt;\n    &lt;fieldset name=&quot;employee-details&quot;&gt;\n        &lt;settings&gt;\n            &lt;label translate=&quot;true&quot;&gt;Employee Details&lt;\/label&gt;\n        &lt;\/settings&gt;\n        &lt;modal name=&quot;employee_modal&quot;&gt;\n            &lt;settings&gt;\n                &lt;options&gt;\n                    &lt;option name=&quot;title&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Add\/Update Employee&lt;\/option&gt;\n                &lt;\/options&gt;\n            &lt;\/settings&gt;\n            &lt;insertForm name=&quot;employee_form_loader&quot; component=&quot;Webkul_UiForm\/js\/form\/components\/insert-form&quot;&gt;\n                &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;employeeListingProvider&quot; xsi:type=&quot;string&quot;&gt;ns = employee_listing, index = employee_listing&lt;\/item&gt;\n                        &lt;item name=&quot;employeeModalProvider&quot; xsi:type=&quot;string&quot;&gt;${ $.parentName }&lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/argument&gt;\n                &lt;settings&gt;\n                    &lt;formSubmitType&gt;ajax&lt;\/formSubmitType&gt;\n                    &lt;renderUrl path=&quot;mui\/index\/render_handle&quot;&gt;\n                        &lt;param name=&quot;handle&quot;&gt;employee_details_manage&lt;\/param&gt;\n                        &lt;param name=&quot;buttons&quot;&gt;1&lt;\/param&gt;\n                    &lt;\/renderUrl&gt;\n                    &lt;loading&gt;false&lt;\/loading&gt;\n                    &lt;toolbarContainer&gt;${ $.parentName }&lt;\/toolbarContainer&gt;\n                    &lt;externalProvider&gt;${ $.ns }.employee_form_data_source&lt;\/externalProvider&gt;\n                    &lt;ns&gt;employee_form&lt;\/ns&gt;\n                &lt;\/settings&gt;\n            &lt;\/insertForm&gt;\n        &lt;\/modal&gt;\n        &lt;button name=&quot;modal_button&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;title&quot; xsi:type=&quot;string&quot;&gt;Add Employee&lt;\/item&gt;\n                    &lt;item name=&quot;formElement&quot; xsi:type=&quot;string&quot;&gt;container&lt;\/item&gt;\n                    &lt;item name=&quot;buttonClasses&quot; xsi:type=&quot;string&quot;&gt;add-new-emp-button&lt;\/item&gt;\n                    &lt;item name=&quot;actions&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;0&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;targetName&quot; xsi:type=&quot;string&quot;&gt;${ $.parentName}.employee_modal.employee_form_loader&lt;\/item&gt;\n                            &lt;item name=&quot;actionName&quot; xsi:type=&quot;string&quot;&gt;destroyInserted&lt;\/item&gt;\n                        &lt;\/item&gt;\n                        &lt;item name=&quot;1&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;targetName&quot; xsi:type=&quot;string&quot;&gt;${ $.parentName}.employee_modal&lt;\/item&gt;\n                            &lt;item name=&quot;actionName&quot; xsi:type=&quot;string&quot;&gt;openModal&lt;\/item&gt;\n                        &lt;\/item&gt;\n                        &lt;item name=&quot;2&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;targetName&quot; xsi:type=&quot;string&quot;&gt;${ $.parentName}.employee_modal.employee_form_loader&lt;\/item&gt;\n                            &lt;item name=&quot;actionName&quot; xsi:type=&quot;string&quot;&gt;render&lt;\/item&gt;\n                        &lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/button&gt;\n        &lt;insertListing name=&quot;employee_listing&quot; component=&quot;Magento_Customer\/js\/form\/components\/insert-listing&quot;&gt;\n            &lt;settings&gt;\n                &lt;dataLinks&gt;\n                    &lt;exports&gt;false&lt;\/exports&gt;\n                    &lt;imports&gt;true&lt;\/imports&gt;\n                &lt;\/dataLinks&gt;\n                &lt;externalProvider&gt;employee_listing.employee_listing_data_source&lt;\/externalProvider&gt;\n                &lt;selectionsProvider&gt;employee_listing.employee_listing.employee_columns.ids&lt;\/selectionsProvider&gt;\n                &lt;autoRender&gt;true&lt;\/autoRender&gt;\n                &lt;dataScope&gt;employee_listing&lt;\/dataScope&gt;\n                &lt;ns&gt;employee_listing&lt;\/ns&gt;\n            &lt;\/settings&gt;\n        &lt;\/insertListing&gt;\n    &lt;\/fieldset&gt;\n&lt;\/form&gt;<\/pre>\n\n\n\n<p><strong>6:-<\/strong> Now add the Employee.php file in folder \u2018Webkul\/UiForm\/Ui\/DataProvider\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\UiForm\\Ui\\DataProvider;\n\nuse Webkul\\UiForm\\Model\\ResourceModel\\Employee\\CollectionFactory;\n\nclass Employee extends \\Magento\\Ui\\DataProvider\\AbstractDataProvider\n{\n    \/**\n     * @var array\n     *\/\n    public $loadedData;\n\n    \/**\n     * @var CollectionFactory\n     *\/\n    protected $collection;\n\n    \/**\n     * __construct function\n     *\n     * @param &#091;type] $name\n     * @param &#091;type] $primaryFieldName\n     * @param &#091;type] $requestFieldName\n     * @param CollectionFactory $collectionFactory\n     * @param array $meta\n     * @param array $data\n     *\/\n    public function __construct(\n        $name,\n        $primaryFieldName,\n        $requestFieldName,\n        CollectionFactory $collectionFactory,\n        array $meta = &#091;],\n        array $data = &#091;]\n    ) {\n        $this-&gt;collection = $collectionFactory-&gt;create();\n        parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);\n    }\n\n    \/**\n     * GetData function\n     *\n     * @return void\n     *\/\n    public function getData()\n    {\n        if (isset($this-&gt;loadedData)) {\n            return $this-&gt;loadedData;\n        }\n        $collectionData = $this-&gt;collection-&gt;getData();\n\n        $this-&gt;loadedData&#091;&#039;employee-details&#039;] = $collectionData;\n        return $this-&gt;loadedData;\n    }\n}<\/pre>\n\n\n\n<p><strong>7:-<\/strong> Create the employee list employee_listing.xml in folder \u2018Webkul\/UiForm\/view\/adminhtml\/ui_component\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;listing xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:module:Magento_Ui:etc\/ui_configuration.xsd&quot;&gt;\n    &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n        &lt;item name=&quot;js_config&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;provider&quot; xsi:type=&quot;string&quot;&gt;employee_listing.employee_listing_data_source&lt;\/item&gt;\n        &lt;\/item&gt;\n    &lt;\/argument&gt;\n    &lt;settings&gt;\n        &lt;spinner&gt;employee_columns&lt;\/spinner&gt;\n        &lt;deps&gt;\n            &lt;dep&gt;employee_listing.employee_listing_data_source&lt;\/dep&gt;\n        &lt;\/deps&gt;\n    &lt;\/settings&gt;\n    &lt;dataSource name=&quot;employee_listing_data_source&quot; component=&quot;Magento_Ui\/js\/grid\/provider&quot;&gt;\n        &lt;settings&gt;\n            &lt;updateUrl path=&quot;mui\/index\/render&quot;\/&gt;\n        &lt;\/settings&gt;\n        &lt;dataProvider class=&quot;Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\DataProvider&quot; name=&quot;employee_listing_data_source&quot;&gt;\n            &lt;settings&gt;\n                &lt;requestFieldName&gt;id&lt;\/requestFieldName&gt;\n                &lt;primaryFieldName&gt;entity_id&lt;\/primaryFieldName&gt;\n            &lt;\/settings&gt;\n        &lt;\/dataProvider&gt;\n    &lt;\/dataSource&gt;\n    &lt;listingToolbar name=&quot;listing_top&quot;&gt;\n        &lt;bookmark name=&quot;bookmarks&quot;\/&gt;\n        &lt;columnsControls name=&quot;columns_controls&quot;\/&gt;\n        &lt;filters name=&quot;listing_filters&quot;\/&gt;\n        &lt;massaction name=&quot;listing_massaction&quot; component=&quot;Magento_Ui\/js\/grid\/tree-massactions&quot;&gt;\n            &lt;action name=&quot;delete&quot;&gt;\n                &lt;settings&gt;\n                    &lt;confirm&gt;\n                        &lt;message translate=&quot;true&quot;&gt;Are you sure you want to delete the selected price rule?&lt;\/message&gt;\n                        &lt;title translate=&quot;true&quot;&gt;Delete Price Rule&lt;\/title&gt;\n                    &lt;\/confirm&gt;\n                    &lt;url path=&quot;expedia\/pricerule\/massDelete&quot;\/&gt;\n                    &lt;type&gt;delete&lt;\/type&gt;\n                    &lt;label translate=&quot;true&quot;&gt;Delete&lt;\/label&gt;\n                &lt;\/settings&gt;\n            &lt;\/action&gt;\n        &lt;\/massaction&gt;\n        &lt;paging name=&quot;listing_paging&quot;\/&gt;\n    &lt;\/listingToolbar&gt;\n    &lt;columns name=&quot;employee_columns&quot; class=&quot;Magento\\Ui\\Component\\Listing\\Columns&quot;&gt;\n        &lt;selectionsColumn name=&quot;ids&quot; sortOrder=&quot;10&quot;&gt;\n            &lt;settings&gt;\n                &lt;indexField&gt;entity_id&lt;\/indexField&gt;\n            &lt;\/settings&gt;\n        &lt;\/selectionsColumn&gt;\n        &lt;column name=&quot;name&quot; sortOrder=&quot;20&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;Employee Name&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;emp_id&quot; sortOrder=&quot;20&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;Employee Name&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;emp_address&quot; sortOrder=&quot;20&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;Employee Name&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;actionsColumn name=&quot;actions&quot; class=&quot;Webkul\\UiForm\\Ui\\Component\\Listing\\Column\\Action&quot; component=&quot;Magento_Customer\/js\/grid\/columns\/actions&quot;&gt;\n            &lt;settings&gt;\n                &lt;indexField&gt;entity_id&lt;\/indexField&gt;\n            &lt;\/settings&gt;\n        &lt;\/actionsColumn&gt;\n    &lt;\/columns&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p><strong>8:-<\/strong> Add column action  Action.php in \u2018Webkul\/UiForm\/Ui\/Component\/Listing\/Column\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\UiForm\\Ui\\Component\\Listing\\Column;\n\nuse Magento\\Framework\\UrlInterface;\nuse Magento\\Ui\\Component\\Listing\\Columns\\Column;\nuse Magento\\Framework\\View\\Element\\UiComponentFactory;\nuse Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface;\n\n\/**\n * Prepare actions column for customer addresses grid\n *\/\nclass Action extends Column\n{\n    \/**\n     * @var UrlInterface\n     *\/\n    private $urlBuilder;\n\n    \/**\n     * @param ContextInterface $context\n     * @param UiComponentFactory $uiComponentFactory\n     * @param UrlInterface $urlBuilder\n     * @param array $components\n     * @param array $data\n     *\/\n    public function __construct(\n        ContextInterface $context,\n        UiComponentFactory $uiComponentFactory,\n        UrlInterface $urlBuilder,\n        array $components = &#091;],\n        array $data = &#091;]\n    ) {\n        $this-&gt;urlBuilder = $urlBuilder;\n        parent::__construct($context, $uiComponentFactory, $components, $data);\n    }\n\n    \/**\n     * Prepare Data Source\n     *\n     * @param array $dataSource\n     * @return array\n     *\/\n    public function prepareDataSource(array $dataSource): array\n    {\n        if (isset($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;])) {\n            foreach ($dataSource&#091;&#039;data&#039;]&#091;&#039;items&#039;] as &amp;$item) {\n                $name = $this-&gt;getData(&#039;name&#039;);\n                if (isset($item&#091;&#039;entity_id&#039;])) {\n                    $item&#091;$name]&#091;&#039;edit&#039;] = &#091;\n                        &#039;callback&#039; =&gt; &#091;\n                            &#091;\n                                &#039;provider&#039; =&gt; &#039;employee_manage_form.areas.employee-details&#039;\n                                    .&#039;.employee-details.employee_modal.employee_form_loader&#039;,\n                                &#039;target&#039; =&gt; &#039;destroyInserted&#039;,\n                            ],\n                            &#091;\n                                &#039;provider&#039; =&gt; &#039;employee_manage_form.areas.employee-details&#039;\n                                    .&#039;.employee-details.employee_modal&#039;,\n                                &#039;target&#039; =&gt; &#039;openModal&#039;,\n                            ],\n                            &#091;\n                                &#039;provider&#039; =&gt; &#039;employee_manage_form.areas.employee-details&#039;\n                                    .&#039;.employee-details.employee_modal.employee_form_loader&#039;,\n                                &#039;target&#039; =&gt; &#039;render&#039;,\n                                &#039;params&#039; =&gt; &#091;\n                                    &#039;id&#039; =&gt; $item&#091;&#039;entity_id&#039;],\n                                ],\n                            ]\n                        ],\n                        &#039;href&#039; =&gt; &#039;#&#039;,\n                        &#039;label&#039; =&gt; __(&#039;Edit&#039;),\n                        &#039;hidden&#039; =&gt; false,\n                    ];\n                }\n            }\n        }\n\n        return $dataSource;\n    }\n}<\/pre>\n\n\n\n<p><strong>9:-<\/strong>  And in last add the component insert-form.js in folder \u2018app\/code\/Webkul\/UiForm\/view\/adminhtml\/web\/js\/form\/components\/insert-form.js\u2019<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">define(&#091;\n    &#039;Magento_Ui\/js\/form\/components\/insert-form&#039;\n], function (Insert) {\n    &#039;use strict&#039;;\n\n    return Insert.extend({\n        defaults: {\n            listens: {\n                responseData: &#039;onResponse&#039;\n            },\n            modules: {\n                employeeListing: &#039;${ $.employeeListingProvider }&#039;,\n                employeeModal: &#039;${ $.employeeModalProvider }&#039;\n            }\n        },\n\n        \/**\n         * Close modal, reload price rule listing and save\n         *\n         * @param {Object} responseData\n         *\/\n        onResponse: function (responseData) {\n            if (!responseData.error) {\n                this.employeeModal().closeModal();\n                this.employeeListing().reload({\n                    refresh: true\n                });\n            }\n        }\n    });\n});<\/pre>\n\n\n\n<p>For example you can also see the below image of the modal pop-up form. As, you can see the form where you can add and edit the employee details using the Ui component form after updating the data it will update the grid data without reloading the page.<\/p>\n\n\n\n<p>For creating the Ui form through Ui component you can also follow our blog. <a href=\"https:\/\/webkul.com\/blog\/create-ui-form-magento2-part-1\/\" target=\"_blank\" rel=\"noreferrer noopener\">Click here<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignleft size-full\"><img decoding=\"async\" width=\"1189\" height=\"621\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\" alt=\"Ui_Grid-1\" class=\"wp-image-374281\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png 1189w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1-300x157.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1-250x131.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1-768x401.png 768w\" sizes=\"(max-width: 1189px) 100vw, 1189px\" loading=\"lazy\" \/><\/figure>\n<\/div>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1162\" height=\"610\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_form.png\" alt=\"Ui_form\" class=\"wp-image-374280\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_form.png 1162w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_form-300x157.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_form-250x131.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_form-768x403.png 768w\" sizes=\"(max-width: 1162px) 100vw, 1162px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>That\u2019s all about to create a Ui form with the modal pop-up in the admin panel using the Ui component.<\/p>\n\n\n\n<p>Thank you for reading this article on how to create a Ui form in a modal pop-up using Ui Components in Magento 2 Adobe Commerce, we hope you liked it.<\/p>\n\n\n\n<p>You can also view our wide range of ready-to-use&nbsp;Adobe commerce extensions.<\/p>\n\n\n\n<p>Furthermore, If for any more queries, please reach out to our team via&nbsp;<a href=\"https:\/\/webkul.uvdesk.com\/en\/customer\/create-ticket\/\">support<\/a>&nbsp;ticket.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will see how to create an Ui form in a modal pop-up in adobe commerce.Yes, like admin grid, we can also create forms using the Ui component and open that form in a modal popup through the Ui component. Before we will use the tempate and jQuery for creating modal pop-up <a href=\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":365,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,9121,302],"tags":[12967,12043],"class_list":["post-369368","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento-2","category-magento2","tag-adobe-commerce","tag-ui-component-form"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog<\/title>\n<meta name=\"description\" content=\"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-29T12:27:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-23T13:08:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\" \/>\n<meta name=\"author\" content=\"Saurav Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Saurav Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\"},\"author\":{\"name\":\"Saurav Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426\"},\"headline\":\"Open UI Form In Modal PopUp In Adobe Commerce\",\"datePublished\":\"2023-03-29T12:27:58+00:00\",\"dateModified\":\"2024-05-23T13:08:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\"},\"wordCount\":459,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\",\"keywords\":[\"Adobe Commerce\",\"UI component form\"],\"articleSection\":[\"magento\",\"Magento 2\",\"Magento2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\",\"url\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\",\"name\":\"Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\",\"datePublished\":\"2023-03-29T12:27:58+00:00\",\"dateModified\":\"2024-05-23T13:08:02+00:00\",\"description\":\"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png\",\"width\":1189,\"height\":621,\"caption\":\"Ui_Grid-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Open UI Form In Modal PopUp In Adobe Commerce\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426\",\"name\":\"Saurav Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Saurav Kumar\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/sauravkumar-magento981\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog","description":"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/","og_locale":"en_US","og_type":"article","og_title":"Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog","og_description":"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce","og_url":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-03-29T12:27:58+00:00","article_modified_time":"2024-05-23T13:08:02+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png","type":"","width":"","height":""}],"author":"Saurav Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Saurav Kumar","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/"},"author":{"name":"Saurav Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426"},"headline":"Open UI Form In Modal PopUp In Adobe Commerce","datePublished":"2023-03-29T12:27:58+00:00","dateModified":"2024-05-23T13:08:02+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/"},"wordCount":459,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png","keywords":["Adobe Commerce","UI component form"],"articleSection":["magento","Magento 2","Magento2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/","url":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/","name":"Open UI Form In Modal PopUp In Adobe Commerce - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png","datePublished":"2023-03-29T12:27:58+00:00","dateModified":"2024-05-23T13:08:02+00:00","description":"We can also create forms using the Ui component and open that form in a modal popup through the Ui component in adobe commerce","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/03\/Ui_Grid-1.png","width":1189,"height":621,"caption":"Ui_Grid-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/open-ui-form-in-modal-popup-in-adobe-commerce\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Open UI Form In Modal PopUp In Adobe Commerce"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/e63462ecf811e98b26fee808c67a6426","name":"Saurav Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/decace4591552fae8d7c6b2415e15831d78f0d6edefd9d8a3c79ec51333cce97?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Saurav Kumar"},"url":"https:\/\/webkul.com\/blog\/author\/sauravkumar-magento981\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/365"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=369368"}],"version-history":[{"count":51,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369368\/revisions"}],"predecessor-version":[{"id":374591,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/369368\/revisions\/374591"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=369368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=369368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=369368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}