Question

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?

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top