Get props in List of List of Object based on Specific Index in Sightly
Hello All,
I have a list which I call rows here, then inside that I have another list which is list itself, but I want to get specific index of that list based on outer list index.(rowsList.index), after that I will get the objects inside inner list to show props.
But it is not going inside <sly data-sly-list.singleList="${logic.listOLists[rowsList.index]}">
I have these two list in my service:
public ArrayList<ArrayList<List<MyObject>>> listOfLists = new ArrayList<ArrayList<List<MyObject>>>();
public ArrayList<List<MyObject>> singleList = new ArrayList<List<MyObject>>();
each item of singleList is like this:
public List<MyObject> myObject = new ArrayList<>();
How should I get inside that listOfLists based on index of outter list?
What is exactly method I need to make sure it will get name/label/required from myobject?
I know that service is adding correctly to the "listOfLists" and "singleList".
Here is part of my sightly.
<div data-sly-use.logic="xx.xx.model.searchRows">
<table>
<sly data-sly-list.rows="${logic.selectedRows}">
<tr>
<td>
<input type="text" id="name" name="name" value=${rows.name}>
</td>
<td>
<sly data-sly-list.singleList="${logic.listOfLists[rowsList.index]}">
<sly data-sly-list.innerList="${singleList.listChildren}">
<h2>${innerList.name} - ${innerList.label} - ${innerList.href}</h2>
</sly>
</sly>
</td>
</tr>
</sly>
</table>
</div>
Thanks for your time.