Expand my Community achievements bar.

SOLVED

Order of Items at Sling context site configuration

Avatar

Level 2

Hi Team,

 

We are using Sling context aware config. But we want to arrange order. 

for eg:

@Property(label = "Enter the button Label", description = "Button Label")
String buttonLabel();
@Property(label = "Enter the title1, description = "Enter the title1")
String title2();
@Property(label = "Enter the title, description = "Enter the title")
String title();
@Property(label = "Enter the title1, description = "Enter the title1")
String title1();

 

When we deploy squence is random. How to show title as first attribute then title1, title2, buttonlabel?

TIA

Naina

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can use "order=n" to @property. Below is the example:

@Property(label = "Enter the title, description = "Enter the title", order = 1)
String title();
@Property(label = "Enter the title1, description = "Enter the title1",order = 2)
String title1();
@Property(label = "Enter the title1, description = "Enter the title1",order = 3)
String title2();
@Property(label = "Enter the button Label", description = "Button Label",order = 4)
String buttonLabel();

 Refer https://sunsushil.wordpress.com/2021/05/12/context-aware-configuration-in-aem/ for more details.

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

You can use "order=n" to @property. Below is the example:

@Property(label = "Enter the title, description = "Enter the title", order = 1)
String title();
@Property(label = "Enter the title1, description = "Enter the title1",order = 2)
String title1();
@Property(label = "Enter the title1, description = "Enter the title1",order = 3)
String title2();
@Property(label = "Enter the button Label", description = "Button Label",order = 4)
String buttonLabel();

 Refer https://sunsushil.wordpress.com/2021/05/12/context-aware-configuration-in-aem/ for more details.

Avatar

Level 5

Hi @naina01 ,

 

you can use the "order" attribute at the annotation level where it will define the 

Number to control property order in the configuration editor. The default value will be 0.

ex:

@Property(label = "Enter the button Label", description = "Button Label", order=3)
String buttonLabel();
@Property(label = "Enter the title1, description = "Enter the title1", order=2)
String title2();
@Property(label = "Enter the title, description = "Enter the title")
String title();
@Property(label = "Enter the title1, description = "Enter the title1", order=1)
String title1();