Hi,
Suppose, I have a pathbrowser within multifield. For instance I select two paths in dialog, which is stored in backend as {"pagePath":"/content/test1"}, {"pagePath":"/content/test2"}. I want to retrieve the jcr: title of these two pages. How do I go about doing this.
If I were to use, WCMUsePOJO's/activate method, I would have done something like
ValueMap properties = getProperties();
if (properties.containsKey("multifieldPropertystoredincrx")) {
String[] paths= properties.get("multifieldPropertystoredincrx", String[].class);
for (int i = 0; (null != paths) && (i < paths.length); i++) {
JSONObject obj = new JSONObject(paths[i]);
if (obj.has("pagePath")) {
String productPath = obj.getString("pagePath"));
and so on.
But with SlingModel, I am not getting how to go about this. Any thoughts on this will be really helpful.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Use some other API.. jackson and gson can be used here. I believe both are available with AEM 6.3
Java POJO to JSON using Gson (com.google.gson.Gson) - CoderMagnet - JAVA JCR AEM Sightly Resource
Views
Replies
Total Likes
You can follow this link hope you will get the idea.
Multifield Component in Sightly with Sling Models | TechCookies
Hi zeeshank15007365,
Thanks a lot for sharing this link across.
In AEM 6.3, JSONObject is deprecated and as a result , cannot proceed with the same.
Any link/pointers on how to achieve this without JSONObject api, would be helpful.
Views
Replies
Total Likes
Use some other API.. jackson and gson can be used here. I believe both are available with AEM 6.3
cq5 - org.apache.sling.commons.json.JSONArray is deprecated in AEM 6.3 - Stack Overflow
Views
Replies
Total Likes
Hi
Use some other API.. jackson and gson can be used here. I believe both are available with AEM 6.3
Java POJO to JSON using Gson (com.google.gson.Gson) - CoderMagnet - JAVA JCR AEM Sightly Resource
Views
Replies
Total Likes
Thank you
Views
Replies
Total Likes
Views
Like
Replies