• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with nested <logic:iterate>

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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" >
<html:optionsCollection name="dtlsInner" property="snpList.name" />
</html:select>
</logic:iterate>
</td>
</tr>
</logic:iterate>
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:


 
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic