{"id":292845,"date":"2021-06-16T14:27:24","date_gmt":"2021-06-16T14:27:24","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=292845"},"modified":"2024-07-26T12:26:00","modified_gmt":"2024-07-26T12:26:00","slug":"magento-development-17-uicomponent-form","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/","title":{"rendered":"Magento 2 Development 20: uiComponent form"},"content":{"rendered":"\n<p>Now that we have covered most of the part of the admin grid. Let&#8217;s learn about forms in admin.<\/p>\n\n\n\n<p>There are two very popular ways of creating forms in admin,<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The first one will be with uiComponent, this is the recommended way of creating a form.<\/li>\n\n\n\n<li>However, in many cases, you will find that the forms are implemented with block class and widgets.<\/li>\n<\/ol>\n\n\n\n<p>We will see both ways but in this blog, I will show, how to create the form with the ui-component. And in the next blog, we will create the form with a block class.<\/p>\n\n\n\n<p>First of all, we need to add the edit link to the grid. We have seen in the previous blog itself how to add the link column or the action column in the admin grid. Let&#8217;s quickly create the column by following the <a href=\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\" target=\"_blank\" rel=\"noreferrer noopener\">previous blog&#8217;s<\/a> steps.<\/p>\n\n\n\n<p>We will have to edit the <em>view\/adminhtml\/ui_component\/blogmanager_blog_listing.xml<\/em> file to add the column,<\/p>\n\n\n\n<p>Updated code for <em>view\/adminhtml\/ui_component\/blogmanager_blog_listing.xml<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&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;blogmanager_blog_listing.blogmanager_blog_listing_data_source&lt;\/item&gt;\n            &lt;item name=&quot;deps&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing.blogmanager_blog_listing_data_source&lt;\/item&gt;\n        &lt;\/item&gt;\n        &lt;item name=&quot;spinner&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_columns&lt;\/item&gt;\n    &lt;\/argument&gt;\n    &lt;dataSource name=&quot;blogmanager_blog_listing_data_source&quot;&gt;\n        &lt;argument name=&quot;dataProvider&quot; xsi:type=&quot;configurableObject&quot;&gt;\n            &lt;argument name=&quot;class&quot; xsi:type=&quot;string&quot;&gt;Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\DataProvider&lt;\/argument&gt;\n            &lt;argument name=&quot;name&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing_data_source&lt;\/argument&gt;\n            &lt;argument name=&quot;primaryFieldName&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/argument&gt;\n            &lt;argument name=&quot;requestFieldName&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/argument&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;update_url&quot; xsi:type=&quot;url&quot; path=&quot;mui\/index\/render&quot;\/&gt;\n                &lt;item name=&quot;storageConfig&quot; xsi:type=&quot;array&quot;&gt;\n                    &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/argument&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\/grid\/provider&lt;\/item&gt;\n            &lt;\/item&gt;\n        &lt;\/argument&gt;\n    &lt;\/dataSource&gt;\n    &lt;listingToolbar name=&quot;listing_top&quot;&gt;\n        &lt;massaction name=&quot;listing_massaction&quot; component=&quot;Magento_Ui\/js\/grid\/tree-massactions&quot;&gt;\n            &lt;argument name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;data&quot; xsi:type=&quot;array&quot;&gt;\n                &lt;item name=&quot;selectProvider&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_listing.blogmanager_blog_listing.blogmanager_blog_columns.ids&lt;\/item&gt;\n                &lt;item name=&quot;displayArea&quot; xsi:type=&quot;string&quot;&gt;bottom&lt;\/item&gt;\n                &lt;item name=&quot;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;action name=&quot;delete&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;type&quot; xsi:type=&quot;string&quot;&gt;delete&lt;\/item&gt;\n                    &lt;item name=&quot;label&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Delete&lt;\/item&gt;\n                    &lt;item name=&quot;url&quot; xsi:type=&quot;url&quot; path=&quot;blog\/manage\/massDelete&quot;\/&gt;\n                    &lt;item name=&quot;confirm&quot; xsi:type=&quot;array&quot;&gt;\n                        &lt;item name=&quot;title&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Delete Blogs?&lt;\/item&gt;\n                        &lt;item name=&quot;message&quot; xsi:type=&quot;string&quot; translate=&quot;true&quot;&gt;Are you sure you want to delete the selected blogs?&lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/item&gt;\n                &lt;\/argument&gt;\n            &lt;\/action&gt;\n            &lt;action name=&quot;status&quot;&gt;\n                &lt;settings&gt;\n                    &lt;type&gt;status&lt;\/type&gt;\n                    &lt;label translate=&quot;true&quot;&gt;Change status&lt;\/label&gt;\n                    &lt;actions&gt;\n                        &lt;action name=&quot;0&quot;&gt;\n                            &lt;type&gt;enable&lt;\/type&gt;\n                            &lt;label translate=&quot;true&quot;&gt;Enable&lt;\/label&gt;\n                            &lt;url path=&quot;blog\/manage\/massStatus&quot;&gt;\n                                &lt;param name=&quot;status&quot;&gt;1&lt;\/param&gt;\n                            &lt;\/url&gt;\n                        &lt;\/action&gt;\n                        &lt;action name=&quot;1&quot;&gt;\n                            &lt;type&gt;disable&lt;\/type&gt;\n                            &lt;label translate=&quot;true&quot;&gt;Disable&lt;\/label&gt;\n                            &lt;url path=&quot;blog\/manage\/massStatus&quot;&gt;\n                                &lt;param name=&quot;status&quot;&gt;0&lt;\/param&gt;\n                            &lt;\/url&gt;\n                        &lt;\/action&gt;\n                    &lt;\/actions&gt;\n                &lt;\/settings&gt;\n            &lt;\/action&gt;\n        &lt;\/massaction&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;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;templates&quot; xsi:type=&quot;array&quot;&gt;\n                            &lt;item name=&quot;filters&quot; xsi:type=&quot;array&quot;&gt;\n                                &lt;item name=&quot;select&quot; xsi:type=&quot;array&quot;&gt;\n                                    &lt;item name=&quot;component&quot; xsi:type=&quot;string&quot;&gt;Magento_Ui\/js\/form\/element\/ui-select&lt;\/item&gt;\n                                    &lt;item name=&quot;template&quot; xsi:type=&quot;string&quot;&gt;ui\/grid\/filters\/elements\/ui-select&lt;\/item&gt;\n                                &lt;\/item&gt;\n                            &lt;\/item&gt;\n                        &lt;\/item&gt;\n                    &lt;\/item&gt;\n                &lt;\/argument&gt;\n        &lt;\/filters&gt;\n        &lt;paging name=&quot;listing_paging&quot;\/&gt;\n    &lt;\/listingToolbar&gt;\n    &lt;columns name=&quot;blogmanager_blog_columns&quot;&gt;\n        &lt;selectionsColumn name=&quot;ids&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;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n        &lt;\/selectionsColumn&gt;\n        &lt;column name=&quot;entity_id&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;textRange&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;ID&lt;\/label&gt;\n                &lt;resizeDefaultWidth&gt;25&lt;\/resizeDefaultWidth&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;user_name&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;User&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;title&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;text&lt;\/filter&gt;\n                &lt;label translate=&quot;true&quot;&gt;Title&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;content&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns\\Content&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;false&lt;\/filter&gt;\n                &lt;sortable&gt;false&lt;\/sortable&gt;\n                &lt;label translate=&quot;true&quot;&gt;Content&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;status&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/select&quot;&gt;\n            &lt;settings&gt;\n                &lt;options class=&quot;Webkul\\BlogManager\\Model\\Blog\\Status&quot;\/&gt;\n                &lt;dataType&gt;select&lt;\/dataType&gt;\n                &lt;filter&gt;select&lt;\/filter&gt;\n                &lt;sortable&gt;false&lt;\/sortable&gt;\n                &lt;label translate=&quot;true&quot;&gt;Status&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;updated_at&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/date&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;dateRange&lt;\/filter&gt;\n                &lt;dataType&gt;date&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Updated&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;column name=&quot;created_at&quot; component=&quot;Magento_Ui\/js\/grid\/columns\/date&quot;&gt;\n            &lt;settings&gt;\n                &lt;filter&gt;dateRange&lt;\/filter&gt;\n                &lt;dataType&gt;date&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Created&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/column&gt;\n        &lt;actionsColumn name=&quot;edit_action&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns\\EditAction&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;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                    &lt;item name=&quot;viewUrlPath&quot; xsi:type=&quot;string&quot;&gt;blogmanager\/manage\/edit&lt;\/item&gt;\n                    &lt;item name=&quot;urlEntityParamName&quot; xsi:type=&quot;string&quot;&gt;id&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;40&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;label translate=&quot;true&quot;&gt;Edit&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/actionsColumn&gt;\n        &lt;actionsColumn name=&quot;delete_action&quot; class=&quot;Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns\\DeleteAction&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;indexField&quot; xsi:type=&quot;string&quot;&gt;entity_id&lt;\/item&gt;\n                    &lt;item name=&quot;viewUrlPath&quot; xsi:type=&quot;string&quot;&gt;blogmanager\/manage\/delete&lt;\/item&gt;\n                    &lt;item name=&quot;urlEntityParamName&quot; xsi:type=&quot;string&quot;&gt;id&lt;\/item&gt;\n                    &lt;item name=&quot;sortOrder&quot; xsi:type=&quot;number&quot;&gt;50&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;label translate=&quot;true&quot;&gt;Delete&lt;\/label&gt;\n            &lt;\/settings&gt;\n        &lt;\/actionsColumn&gt;\n    &lt;\/columns&gt;\n&lt;\/listing&gt;<\/pre>\n\n\n\n<p>Now we need to create a class for the column, <em>Ui\/Component\/Listing\/Columns\/EditAction.php<\/em><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Ui\\Component\\Listing\\Columns;\n\nuse Magento\\Framework\\UrlInterface;\nuse Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface;\nuse Magento\\Framework\\View\\Element\\UiComponentFactory;\n\nclass EditAction extends \\Magento\\Ui\\Component\\Listing\\Columns\\Column\n{\n    \/**\n     * @var Magento\\Framework\\UrlInterface\n     *\/\n    protected $urlBuilder;\n\n    \/**\n     * Dependency Initilization\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)\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                if (isset($item&#091;&#039;entity_id&#039;])) {\n                    $viewUrlPath = $this-&gt;getData(&#039;config\/viewUrlPath&#039;);\n                    $urlEntityParamName = $this-&gt;getData(&#039;config\/urlEntityParamName&#039;);\n                    $item&#091;$this-&gt;getData(&#039;name&#039;)] = &#091;\n                        &#039;view&#039; =&gt; &#091;\n                            &#039;href&#039; =&gt; $this-&gt;urlBuilder-&gt;getUrl(\n                                $viewUrlPath,\n                                &#091;\n                                    $urlEntityParamName =&gt; $item&#091;&#039;entity_id&#039;],\n                                ]\n                            ),\n                            &#039;label&#039; =&gt; __(&#039;Edit&#039;),\n                        ],\n                    ];\n                }\n            }\n        }\n        return $dataSource;\n    }\n}<\/pre>\n\n\n\n<p>Now you will be able to see the edit column in the admin grid like below,<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"431\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png\" alt=\"Image showing edit column on Admin end.\" class=\"wp-image-292883\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-300x108.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-250x90.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-768x276.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1536x551.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53.png 1831w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>And now we have to create the controller as well, <em>Controller\/Adminhtml\/Manage\/Edit.php<\/em><\/p>\n\n\n\n<p>Code for <em>Controller\/Adminhtml\/Manage\/Edit.php<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Controller\\Adminhtml\\Manage;\n\nuse Magento\\Backend\\App\\Action;\nuse Magento\\Framework\\Controller\\ResultFactory;\n\nclass Edit extends Action\n{\n    \/**\n     * Provides content\n     *\n     * @return \\Magento\\Framework\\View\\Result\\Page\n     *\/\n    public function execute()\n    {\n        $resultPage = $this-&gt;resultFactory-&gt;create(ResultFactory::TYPE_PAGE);\n        $resultPage-&gt;getConfig()-&gt;getTitle()-&gt;prepend(__(&quot;Edit Blog&quot;));\n        return $resultPage;\n    }\n\n    \/**\n     * Check Autherization\n     *\n     * @return boolean\n     *\/\n    public function _isAllowed()\n    {\n        return $this-&gt;_authorization-&gt;isAllowed(&#039;Webkul_BlogManager::edit&#039;);\n    }\n}<\/pre>\n\n\n\n<p>If you remember, how we created the admin grid with ui-component, then it should come automatically to you that we need to create a layout file and then we will have to create the ui-component file.<\/p>\n\n\n\n<p>The layout file will be <em>view\/adminhtml\/layout\/blogmanager_manage_edit.xml<\/em> based on the URL,<\/p>\n\n\n\n<p>Code for <em>view\/adminhtml\/layout\/blogmanager_manage_edit.xml<\/em> file<\/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;body&gt;\n        &lt;referenceContainer name=&quot;content&quot;&gt;\n            &lt;uiComponent name=&quot;blogmanager_blog_editing&quot;\/&gt;\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">The Form Component<\/h3>\n\n\n\n<p>Now we will create the most important file of this blog which is the ui-component file for the form, <em>view\/adminhtml\/ui_component\/blogmanager_blog_editing.xml<\/em><\/p>\n\n\n\n<p>Code for <em>view\/adminhtml\/ui_component\/blogmanager_blog_editing.xml<\/em> file<\/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;blogmanager_blog_editing.blogmanager_blog_editing_data_source&lt;\/item&gt;\n            &lt;item name=&quot;deps&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_editing.blogmanager_blog_editing_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;Blog Data&lt;\/item&gt;\n        &lt;item name=&quot;config&quot; xsi:type=&quot;array&quot;&gt;\n            &lt;item name=&quot;dataScope&quot; xsi:type=&quot;string&quot;&gt;data&lt;\/item&gt;\n            &lt;item name=&quot;namespace&quot; xsi:type=&quot;string&quot;&gt;blogmanager_blog_editing&lt;\/item&gt;\n        &lt;\/item&gt;\n        &lt;item name=&quot;template&quot; xsi:type=&quot;string&quot;&gt;templates\/form\/collapsible&lt;\/item&gt;\n    &lt;\/argument&gt;\n    &lt;dataSource name=&quot;blogmanager_blog_editing_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\\BlogManager\\Model\\Blog\\DataProvider&quot; name=&quot;blogmanager_blog_editing_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;blog_data&quot;&gt;\n        &lt;settings&gt;\n            &lt;label translate=&quot;true&quot;&gt;Blog Data&lt;\/label&gt;\n        &lt;\/settings&gt;\n        &lt;field name=&quot;entity_id&quot; formElement=&quot;input&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;source&quot; xsi:type=&quot;string&quot;&gt;blog&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;dataType&gt;text&lt;\/dataType&gt;\n                &lt;visible&gt;false&lt;\/visible&gt;\n            &lt;\/settings&gt;\n        &lt;\/field&gt;\n        &lt;field name=&quot;title&quot; formElement=&quot;input&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;source&quot; xsi:type=&quot;string&quot;&gt;blog&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;dataType&gt;text&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Title&lt;\/label&gt;\n                &lt;validation&gt;\n                    &lt;rule name=&quot;required-entry&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/rule&gt;\n                &lt;\/validation&gt;\n            &lt;\/settings&gt;\n        &lt;\/field&gt;\n        &lt;field name=&quot;content&quot; formElement=&quot;textarea&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;source&quot; xsi:type=&quot;string&quot;&gt;blog&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;dataType&gt;text&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Content&lt;\/label&gt;\n                &lt;validation&gt;\n                    &lt;rule name=&quot;required-entry&quot; xsi:type=&quot;boolean&quot;&gt;true&lt;\/rule&gt;\n                &lt;\/validation&gt;\n            &lt;\/settings&gt;\n        &lt;\/field&gt;\n        &lt;field name=&quot;status&quot; formElement=&quot;select&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;source&quot; xsi:type=&quot;string&quot;&gt;blog&lt;\/item&gt;\n                &lt;\/item&gt;\n            &lt;\/argument&gt;\n            &lt;settings&gt;\n                &lt;dataType&gt;text&lt;\/dataType&gt;\n                &lt;label translate=&quot;true&quot;&gt;Status&lt;\/label&gt;\n            &lt;\/settings&gt;\n            &lt;formElements&gt;\n                &lt;select&gt;\n                    &lt;settings&gt;\n                        &lt;options class=&quot;Webkul\\BlogManager\\Model\\Blog\\Status&quot;\/&gt;\n                    &lt;\/settings&gt;\n                &lt;\/select&gt;\n            &lt;\/formElements&gt;\n        &lt;\/field&gt;\n    &lt;\/fieldset&gt;\n&lt;\/form&gt;<\/pre>\n\n\n\n<p>You can notice the <strong>dataProvider<\/strong> tag inside the dataSource tag it has a class associated with it which will be responsible for providing the data for the form based on the blog id.<\/p>\n\n\n\n<p>It will get the blog id from the URL based on the value in <strong>requestFieldName<\/strong> and <strong>primaryFieldName<\/strong> will be used to load the model.<\/p>\n\n\n\n<p>We can add multiple group of fields with multiple <strong>fieldset<\/strong> tag. One use case you can see on the product add\/edit page.<\/p>\n\n\n\n<p>We add different fields with field tag and we can configure them as we want in the tag itself. Also please notice for the status field, how we have provided the options with the option class that we created earlier.<\/p>\n\n\n\n<p>It won&#8217;t be possible or practical to explain each and every part of this XML file. And as I said earlier, most of the time you will end up copy-pasting these codes. If you want an in-depth explanation then you can always refer to the magento&#8217;s devdoc. <\/p>\n\n\n\n<p>As of now, I found many things missing from the devdoc itself. In such cases, it is always good to refer to the Magento&#8217;s code which you can find under the <em>\/vendor\/magento<\/em> folder of the root directory.<\/p>\n\n\n\n<p>We have created the uiComponent file but we still have one more file to create. And that file is <em>Model\/Blog\/DataProvider.php<\/em> which is responsible for providing the data for the form.<\/p>\n\n\n\n<p>Code for <em>Model\/Blog\/DataProvider.php<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Webkul\\BlogManager\\Model\\Blog;\n\nuse Magento\\Framework\\Data\\OptionSourceInterface;\n\nclass DataProvider extends \\Magento\\Ui\\DataProvider\\AbstractDataProvider\n{\n    \/**\n     * @var \\Webkul\\BlogManager\\Model\\ResourceModel\\Blog\\Collection\n     *\/\n    protected $collection;\n\n    \/**\n     * @var array\n     *\/\n    protected $loadedData;\n\n    \/**\n     * Dependency Initilization\n     *\n     * @param &#091;type] $name\n     * @param &#091;type] $primaryFieldName\n     * @param &#091;type] $requestFieldName\n     * @param \\Webkul\\BlogManager\\Model\\ResourceModel\\Blog\\CollectionFactory $blogCollectionFactory\n     * @param array $meta\n     * @param array $data\n     *\/\n    public function __construct(\n        $name,\n        $primaryFieldName,\n        $requestFieldName,\n        \\Webkul\\BlogManager\\Model\\ResourceModel\\Blog\\CollectionFactory $blogCollectionFactory,\n        array $meta = &#091;],\n        array $data = &#091;]\n    ) {\n        $this-&gt;collection = $blogCollectionFactory-&gt;create();\n        parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);\n    }\n\n    \/**\n     * Get Data\n     *\n     * @return array\n     *\/\n    public function getData()\n    {\n        if (isset($this-&gt;loadedData)) {\n            return $this-&gt;loadedData;\n        }\n        $items = $this-&gt;collection-&gt;getItems();\n        foreach ($items as $blog) {\n            $this-&gt;loadedData&#091;$blog-&gt;getId()] = $blog-&gt;getData();\n        }\n        return $this-&gt;loadedData;\n    }\n}<\/pre>\n\n\n\n<p>The <strong>getData<\/strong> method will provide the data that is the model for the blog. The collection will be filtered based on the <strong>requestFieldName<\/strong> and <strong>primaryFieldName<\/strong> that we have passed in the parent&#8217;s constructor.<\/p>\n\n\n\n<p>Now when you click on the edit link, you should see the edit form as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"489\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-1200x489.png\" alt=\"Image showing Edit Blog page\" class=\"wp-image-292938\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-1200x489.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-300x122.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-250x102.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-768x313.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29-1536x626.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_19-29.png 1839w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><br>Next Blog -&gt; <a href=\"https:\/\/webkul.com\/blog\/magento-2-development-18-form-widget\/\">Magento 2 Development 21: Form Widget<\/a><\/p>\n\n\n\n<p>Previous Blog -&gt; <a href=\"https:\/\/webkul.com\/blog\/magento-development-16-action-column\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 Development 19: Action Column<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that we have covered most of the part of the admin grid. Let&#8217;s learn about forms in admin. There are two very popular ways of creating forms in admin, We will see both ways but in this blog, I will show, how to create the form with the ui-component. And in the next blog, <a href=\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":201,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[2460],"class_list":["post-292845","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-magento-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 Development 20: uiComponent form - Webkul Blog<\/title>\n<meta name=\"description\" content=\"how to create the form with the ui-component\" \/>\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\/magento-development-17-uicomponent-form\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 Development 20: uiComponent form - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"how to create the form with the ui-component\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\" \/>\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=\"2021-06-16T14:27:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-26T12:26:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png\" \/>\n<meta name=\"author\" content=\"Sanjay Chouhan\" \/>\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=\"Sanjay Chouhan\" \/>\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\/magento-development-17-uicomponent-form\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\"},\"author\":{\"name\":\"Sanjay Chouhan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462\"},\"headline\":\"Magento 2 Development 20: uiComponent form\",\"datePublished\":\"2021-06-16T14:27:24+00:00\",\"dateModified\":\"2024-07-26T12:26:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\"},\"wordCount\":647,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png\",\"keywords\":[\"Magento 2\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\",\"url\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\",\"name\":\"Magento 2 Development 20: uiComponent form - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png\",\"datePublished\":\"2021-06-16T14:27:24+00:00\",\"dateModified\":\"2024-07-26T12:26:00+00:00\",\"description\":\"how to create the form with the ui-component\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53.png\",\"width\":1831,\"height\":657},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Magento 2 Development 20: uiComponent form\"}]},{\"@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\/645580979f637b0e355deea21bd07462\",\"name\":\"Sanjay Chouhan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?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\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sanjay Chouhan\"},\"sameAs\":[\"https:\/\/www.instagram.com\/sanjaychouhansc\/\",\"https:\/\/in.linkedin.com\/in\/scchouhansanjay\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Magento 2 Development 20: uiComponent form - Webkul Blog","description":"how to create the form with the ui-component","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\/magento-development-17-uicomponent-form\/","og_locale":"en_US","og_type":"article","og_title":"Magento 2 Development 20: uiComponent form - Webkul Blog","og_description":"how to create the form with the ui-component","og_url":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-06-16T14:27:24+00:00","article_modified_time":"2024-07-26T12:26:00+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png","type":"","width":"","height":""}],"author":"Sanjay Chouhan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sanjay Chouhan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/"},"author":{"name":"Sanjay Chouhan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462"},"headline":"Magento 2 Development 20: uiComponent form","datePublished":"2021-06-16T14:27:24+00:00","dateModified":"2024-07-26T12:26:00+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/"},"wordCount":647,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png","keywords":["Magento 2"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/","url":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/","name":"Magento 2 Development 20: uiComponent form - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53-1200x431.png","datePublished":"2021-06-16T14:27:24+00:00","dateModified":"2024-07-26T12:26:00+00:00","description":"how to create the form with the ui-component","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/06\/2021-06-16_17-53.png","width":1831,"height":657},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/magento-development-17-uicomponent-form\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Magento 2 Development 20: uiComponent form"}]},{"@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\/645580979f637b0e355deea21bd07462","name":"Sanjay Chouhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?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\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sanjay Chouhan"},"sameAs":["https:\/\/www.instagram.com\/sanjaychouhansc\/","https:\/\/in.linkedin.com\/in\/scchouhansanjay"],"url":"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/292845","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\/201"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=292845"}],"version-history":[{"count":10,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/292845\/revisions"}],"predecessor-version":[{"id":455034,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/292845\/revisions\/455034"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=292845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=292845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=292845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}