Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with nested <logic:iterate>

 
Hd Desai
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a scenario where i need to display table with n number of rows where each row will have a dropdown box.

This application is in struts 1.2 and I am not able to retrive value in <logic:iterate> and I get blank.

Here is my code snippet.Help on this would be appreciated.Thanks in advance.

<logic:iterate id="dtls" name="issCrdMaintForm" property="tmpRatingList" indexId="i">
<tr class="${tdClass}" >
<td >${dtls.id}
<html:hidden property="tmpRatingList[${i}].id" value="${dtls.id}"/>
</td>
<td >
<logic:iterate name="issCrdMaintForm" id="dtlsInner" property="snpList" indexId ="j">
<html:select property="tmpRatingList[${i}].snpList[${j}].value" >
<htmlptionsCollection name="dtlsInner" property="snpList.name" />
</html:select>
</logic:iterate>
</td>
</tr>
</logic:iterate>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"s nk", please check your private messages for an important administrative matter. Thanks.
 
Hd Desai
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Sorry I am new here, if you can guide me where to look for private messages, I can do the needful .

Thanks
 
Jaimesh M Ponkia
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hd Desai wrote:Hi Bear,

Sorry I am new here, if you can guide me where to look for private messages, I can do the needful .

Thanks


You will it on the top right side, search for "My Private Messages".

Did you verify if your collections are getting populated correctly? Try putting a notEmpty tag before iterating to check the same.
 
Hd Desai
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes I could find PM link and changed it.

Coming to my query,second list is not empty, it has values.But I think there is some syntax problem or different way to use it

basically what i have is
ArrayList Parent
id
name
ArrayList Child

where child has objects say obj with attribute as name.

I want to display this object contained in ArrayList Child as dropdown box.

Help would be appreciated.Thanks in advance.
 
Jaimesh M Ponkia
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no need to use iterator for the drop down list that you are displaying.

Something like this should work for you:


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic