Hello Community!
I was working on WCMUserPojo to retrieve data from multifield.
I could get multifield data in json all the way to HTL However, I have a problem.
Seemed like HTL knows how many elements in the json but it does not show the text I wanted to show.
In my HTL I have following code
in my MultiFieldSubMenuController
In my MultiFieldSubmenu
Out puts of Logger are
Actual out put on the page is
I also tried to add context to see what happen but it gave me the same result.
Does anybody know why HTL does not show data inside of the object and its solution?
Thank you for your time.
Ryu
Views
Replies
Total Likes
Are you sure there that setId / setText get valid values?
Views
Replies
Total Likes
Hello Feike Visser
I checked added Logger in getText and getId methods. It seemed like MultiFieldSubMenu class has never gotten called by HTL.
As my understanding, sly-use gets whole Json array from Java Class and list through the each items in the Json array and ${ var } notation can gives you each field of json value. so, I'm not sure if I need get method for each field...
Let's me know what you think
thanks !
Ryu
Views
Replies
Total Likes
To me you are mixing concepts of JSON and Java, in your example you transform JSON into Java, so at the point HTL is not dealing anymore with JSON
Views
Replies
Total Likes
I'm sorry
I think I didn't quite explain right for previous comment.
As you can see from the code I provided. Only place jason string shows up is that when they insert variables into MultiFieldSubMenu node.because multifeld in dialog holds json object. We need to convert into Java object.
So by the time it gets passed to HTL, the object in the HTL is arraylist that's has MultiFieldSubMenu class nodes.
It iterates each item but it still missing the class variables. The ${item.text}, for example, does not call the getText method in MultiFieldSubMenu.
LOGGER output shows the array lists contain adequate class nodes, so I think if it iterated each item belong to the MultiFieldSubMenu not MultiFieldSubMenu controller class.
There is tutorial made by adobe Adobe Experience Manager Help | Creating an AEM 6.2 HTML Template Language component that uses a Mul...
I referenced the document while making this example.
Views
Replies
Total Likes
Although I just found a solution, I don't think this is a proper fix. But it works on my AEM
In the MultiFieldSubMenuController class, I added iterator values.
and get methods for both items
I thought the once iterated item in the slightly list, I thought it points to whatever element in side of object but it seemed like not.
HTL still looking for get method inside of Controller class.
Even I found work around, I still want to see proper way to retrieve MultiFields values.
Thanks,
Ryu
Views
Replies
Total Likes
Views
Likes
Replies