I wonder if someone can help.
Background Architecture:
I have an application which contians many areas which have many specific questions, where these questions contian progress
So at a high-level view there can be many applications. A user is associated to maybe many applications.
So I have a list of applications and I can quite easliy iterate my way through and get its relevant details. But when it comes to accessing each specific area to get question progress for some reason it does not work out form me.
So here is logic I want:
for the applications
display its details
for each area(applicaitonId)
display each its completion progress
so to translate to struts I have this
<s:iterator id="app" value="appList" status="row">
<s:iterator id="qsp" value="questionProgessList[%{#row.index}]" status="status">
so applist
is the list of all applications with its own getter/setter && questionSetProgress
is defined by:
List<ApplicationQuestionSetProgress> getQuestionProgressList(final int index)
or List> getQuestionProgressList()
So trying in many ways to access the list has proved futile I have tried:
<s:iterator id="qsp" value="questionProgessList">
<s:property />
</s:iterator>
with this:
List<List<ApplicationQuestionSetProgress>> getQuestionProgressList()
but no joy
I've also tried using the iterator index to call the method but it just does not work out.
List<ApplicationQuestionSetProgress> getQuestionProgressList(final int index)
i.e.
<s:iterator id="qsp" value="questionProgessList[%{#row.index}]" status="status"> or <s:iterator id="qsp" value="questionProgessList(%{#row.index})" status="status">
any hints or tips??
TIA
> then the inner iterator does not even need a name attribute (just an empty tag will do). Status and var have all kinds of uses but in general if you want to write record numbers or array indexes into the html then you will need status (although struts2 in general does not need indexes) and if you need to write properties of an outer iterator into the nested iterators then var is a good idea.
– Quaternion Apr 28 '12 at 20:28