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

How to read value from Sling:OsgiConfig ??

Avatar

Not applicable

I have created a node of type Sling:OsgiConfig and it has value in field property "loginurl" which is of string type. Now I have created a dialog box which needs to populate the value in "loginurl" to a text field in that dialog box. Any help to understand this situation or solution is much appreciated. 

0 Replies

Avatar

Level 10
  • Add a loadcontent listener on textfield which will send request to [1] and get the json response
  • Parse the response and use setValue() on textfield to put the required value

Sample config:

http://localhost:4502/apps/project/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl.json

Avatar

Administrator

Hi

 

There is one good article apart from all above mentioned for your reference, covering creation of "sling:OsgiConfig" using different methods and reading properties of the same.

Link:- http://www.wemblog.com/2012/10/how-to-work-with-configurations-in-cq.html

 

I hope this would help you.

 

Thanks and Regards

Kautuk Sahni

Avatar

Employee Advisor

Hi,

If you have created a sling:osgiConfig node, you should have a service or component, which is using this configuration setting. Then this component/service should render the value.

Jörg