Hi,
I have create one OSGi Configuration in that i have 3 Fields
I need 3rd Field as multifield how we can make Field as multifield in OSGI Configuration.
Solved! Go to Solution.
Views
Replies
Total Likes
Please refer to this OSGI R6 Configuration @AttributeDefinition Essentials Reference Guide, during the development of your OSGI configurations, https://sourcedcode.com/blog/aem/osgi-r6-configuration-attributedefinition-essentials-reference-guid...
This will allow you to quickly craft together your OSGI configs in no time.
Something like this would initiate a String[]
@AttributeDefinition(
name = "String[] Label",
description = "String[] Config Example Description",
type = AttributeType.STRING)
String[] config_string_array_example() default {"item1", "item2"};
Hi @manikanthar1295 ,
The below thread will help you-
In your OCD, it should be like this-
@AttributeDefinition(name = "My prop", description = "Multi values")
String[] getMyPropValues();
@manikanthar1295 Please refer to Set and Get OSGI Configuration values using Multifield section of below article URL:
https://aem4beginner.blogspot.com/create-custom-osgi-configuration-in-aem
Just declare as String[] rather than String in your java class(Object Class definition).
@AttributeDefinition(name = "Custom Config", description = "Custom Config description")
String[] getCustomConfig();
Hope this helps!
Thanks
Please refer to this OSGI R6 Configuration @AttributeDefinition Essentials Reference Guide, during the development of your OSGI configurations, https://sourcedcode.com/blog/aem/osgi-r6-configuration-attributedefinition-essentials-reference-guid...
This will allow you to quickly craft together your OSGI configs in no time.
Something like this would initiate a String[]
@AttributeDefinition(
name = "String[] Label",
description = "String[] Config Example Description",
type = AttributeType.STRING)
String[] config_string_array_example() default {"item1", "item2"};