- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2019
11:55 PM
08-25-2019
11:55 PM
How to add Multiline component field in admin form using ui component
I want to add a field like Street address in my custom module. same as customer Address Add from back-end form. it will look like the below image.
How can I add this kind of field using the UI component?
I have used the below code to display a multiline component. But it is not displaying a filed label.
<field name="address"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="component" xsi:type="string" translate="true">Magento_Ui/js/form/components/group</item> <item name="dataType" xsi:type="string">text</item> <item name="size" xsi:type="number">2</item> <item name="formElement" xsi:type="string">multiline</item> <item name="visible" xsi:type="boolean">true</item> <item name="source" xsi:type="string">store</item> <item name="validation" xsi:type="array"> <item name="required-entry" xsi:type="boolean">true</item> </item> </item> <item name="label" xsi:type="string" translate="true">Address</item> </argument> </field>
And also I would like to create a field using a new UI-component form code method, the above code is an older code method.
If Issue Solved, Click Kudos/Accept As solutions.
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023
10:06 PM
10-12-2023
10:06 PM
Re: How to add Multiline component field in admin form using ui component
I added multiline component using below code and it worked -
<field name="address">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="component" xsi:type="string" translate="true">Magento_Ui/js/form/components/group</item>
<item name="dataType" xsi:type="string">text</item>
<item name="label" xsi:type="string" translate="true">Address</item>
<item name="size" xsi:type="number">2</item>
<item name="formElement" xsi:type="string">multiline</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="source" xsi:type="string">store</item>
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
</item>
</argument>
</field>
If Issue Solved, Click Kudos/Accept As solutions.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023
01:02 AM
10-17-2023
01:02 AM
Re: How to add Multiline component field in admin form using ui component
Effectively oversee all facets of your team, encompassing the recruitment and cultivation of players, enhancing their statistical performance, baseball 9