Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Unable to increase left indent/margin on drop-down list value (not label)

Avatar

Level 5

Hello,

Why is it that I cannot increase the left margin for the value portion of drop-down fields?  Just to clarify, I'm not trying increase the left margin in the Layout tab of the object, but the left indent or margin of the value being selected in the drop-down list.  The text is right up against the left side of the drop-down box, as you can see in the first image below, where Advocacy" is.   When I go into Paragraph formatting, the Left indent that cannot be increased from zero.  Any help is appreciated.


temp.png


temp2.png


1 Accepted Solution

Avatar

Correct answer by
Level 7

you can also trick it. This seems to work. Set the field as a text field and set the indent. Then go to Object Field Type and change it to a Drop-down list. This seems to maintain the indent.

View solution in original post

5 Replies

Avatar

Level 10

Hi there,

Never noticed that there was problems with drop down lists..

I looked upon it and realised you can only set the leftInset for the Caption value in the Paragraph tab

If you want to set a margin for the inside box : e.g. (Advocacy in the image above) you have 2 different ways to do this

1.

Go in the XML Source of the drop down list

Look for the node <choiceList>, and insert a margin node, see below

OR

2.

On a JavaScript event (e.g.: initialize)

this.ui.choiceList.margin.leftInset = "1.27mm";

Avatar

Correct answer by
Level 7

you can also trick it. This seems to work. Set the field as a text field and set the indent. Then go to Object Field Type and change it to a Drop-down list. This seems to maintain the indent.

Avatar

Level 5

I did this and it didn't work for me, sorry.

Avatar

Level 5

Great trick!  It worked.  The only problem was repopulating the drop-down items, cause all that gets lost when you change the field type.  So what I did was copy the field as is, then paste into Word, which brings a bunch of XML with it.  From there I grabbed the text I needed to regenerate the list and used the clipboard button in the LC Object panel to import them back in.

Avatar

Level 5

After digging a little deeper, I noticed that using your trick made a change to the Initialize event of the field, adding this script:


this.margin.leftInset = "0.02in";


I thought it would be worth noting for future readers.  In my case, I went and "tricked" about ten fields; next time it'll be easier, knowing I can just use this script.