I have text field in Ui form

<field name="view">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="sortOrder" xsi:type="number">140</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" translate="true" xsi:type="string">View</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">popup</item>
            <item name="dataScope" xsi:type="string">view</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">false</item>

It's shows like this but I want only label instead of textbox

enter image description here

  • <item name="dataType" xsi:type="string">label</item> ? – Ankit Shah Apr 19 '17 at 6:25
  • 1
    @AnkitShah I already tried this but it's not working. – Prince Patel Apr 19 '17 at 6:37

Can't find answer for this anywhere, so will leave my solution on this old thread:

<field formElement="input" name="field_name">
        <label translate="true">Field label</label>
        <dataScope>field name</dataScope>

Use Input type "text" with read-only : true and with CSS hide the borders. This is uggly but works

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.