Order of Items at Sling context site configuration | Community
Skip to main content
Level 2
January 25, 2023
Solved

Order of Items at Sling context site configuration

  • January 25, 2023
  • 2 replies
  • 915 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by HeenaMadan

You can use "order=n" to @2542150. 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.

2 replies

HeenaMadan
Community Advisor and Adobe Champion
HeenaMadanCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
January 25, 2023

You can use "order=n" to @2542150. 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.

naina01Author
Level 2
January 25, 2023

Its working.

Thanks

sravs
Community Advisor
Community Advisor
January 25, 2023

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