Skip to main content
umashankar_d
Level 2
Mar 29, 2020 11:44 PM UTC
Solved

How to set default value to "textfield" in Touch UI dialog?

Hi Team,

I am trying to set default values to a "textfield" under cq:dialog (Touch UI dialog) of a component.

The sling:resourceType of "textfield" is "granite/ui/components/coral/foundation/form/textfield". I have tried using the "value" property to set the default value of the textfield, but it doesn't seem to work. I've gone through the Coral UI API docs and it's very clearly mentioned that the "value" property can be used to set the default value of a textbox, and that accepts values of "StringEL" type.

Can anyone please help me in achieving this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
BrianKasingli
BrianKasingliAccepted solution
Adobe Champion and Community Advisor
Mar 30, 2020 6:08 PM UTC

@umashankar_d 

You can try this code below:

 

<title jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldLabel="Title" name="./title" value="This is the default title text"/>

 

take a look at this documentation. You can also insert placeholder text with the property of "emptyText" - https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html

2 replies

Theo_Pendle
Level 8
Mar 30, 2020 4:03 PM UTC
I find this very strange, it works fine for me. Could you show us the XML for the entire cq:dialog node please?
Translate
BrianKasingli
Adobe Champion and Community Advisor
BrianKasingliAdobe Champion and Community AdvisorAccepted solution
Adobe Champion and Community Advisor
Mar 30, 2020 6:08 PM UTC

@umashankar_d 

You can try this code below:

 

<title jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldLabel="Title" name="./title" value="This is the default title text"/>

 

take a look at this documentation. You can also insert placeholder text with the property of "emptyText" - https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/textfield/index.html

Translate