Question

Dear Friends, I have a iterator with one list. I had another iterator inside previous iterator. I want to show first list value by the key of second list value. How to acheieve that. Please help me.

<s:iterator value="listOne" var="one">
     <s:iterator value="listsecond" var="second" status="stat">
        <s:textfield name="colDyn%{#stat.index}" value="%{one.second.name}"/>
     </s:iterator>
 </s:iterator>

I tried this with set tag

  <s:set value="#second.name" var="field1" scope="page"/>
  <s:textfield name="colDyn%{#stat.index}" value="%{one.#field1}"/>

But this gives the "key" only. But i want value of that Key.. Thanks in Advance...

Was it helpful?

Solution

don't know exact but you have to try something like this with trial & error

<s:iterator value="listOne" var="one">
    <s:iterator value="listsecond" var="second" status="stat">

         <s:property value="#one[#second.index]" />
    </s:iterator>
     </s:iterator>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top