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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
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
Level 7

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
Level 7

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 4

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();