Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

umashankar_d
Level 2
Level 2

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?

1 Accepted Solution
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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...

View solution in original post

2 Replies
Theo_Pendle
Community Advisor
Community Advisor
I find this very strange, it works fine for me. Could you show us the XML for the entire cq:dialog node please?
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@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...

View solution in original post