Sign in to Community
Sign in to view all badges
I am using AEM 6.3 SP1 and creating a touch ui dialog using coral ui 3.
Dialog has drop-down. I want to populate the drop down options from resource e.g. file.json. where options are stored as a string json key-value pare.
To do this - you need to use a WCMUSEPOJO class and read the JSON file using Java app logic.
Then you need to set a DataSource object and put the JSON values into this Object. That way - the DataSource object is populated with JSON data and will populate a drop-down (Select field).
See this article to learn how to use a DataSource Object to populate a Select field in a Touch UI dialog.
Adobe Experience Manager Help | Using an WCMUsePojo class to populate an Experience Manager Touch UI...
This is how you can dynamically populate a Select field or use other data types like XML or JSON. Parse the JSON and populate the DataSource object - which will then be displayed in the Select field.
As shown in the article - you can use a Map object to define the values. After you parse the values from the JSON data, place them into the MAP.
final Map<String, String> countries = new LinkedHashMap<String, String>();
Map<String, String> countries =
countries.put("us", "United States");
Hope this helps....
Thanks for sharing approach !