Search code examples
extjsaemcrx

How to display textField in the Inputfield?


I have the following tag in some cq5 dialog.xml:

<text jcr:primaryType="cq:Widget" fieldLabel="label" name="./text"
 maxLength="150" xtype="textfield"  value ="This text has to be displayed in the input field"/>

Now when I call the dialog, I expect to see the following: enter image description here

but the Inputfiled is empty :(

Any Idea?


Solution

  • Use defaultValue property:

    <text
        jcr:primaryType="cq:Widget"
        fieldLabel="label"
        name="./text"
        maxLength="150"
        xtype="textfield"
        defaultValue="This text has to be displayed in the input field" />
    

    More info can be found on the CQ5 Widgets API documentation.