Dynamically getting One list value with the key of another list value

718 views Asked by At

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...

1

There are 1 answers

0
Pratik Shah On BEST ANSWER

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>