• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to use html:optionCollection inside a c:forEach

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem description:::::



E1001Form.standardFactorParamBeanList= is a list of standardFactParamBean beans.



(each standardFactParamBean contains 4 things.

1. arraylist of strings named(languageClassificationCollection)

2. string CommentStepCount

3. string NewManual

4. string ReplacementsManual

With all respective getters and setters.

)







I need to get each bean from the standardFactorParamBeanList so I am using (c:forEach var = "sFPBean" items = "${requestScope.E1001Form.standardFactorParamBeanList}����..)



And from each bean I want the 1st table column to be filled by combobox of languageClassificationCollection

2nd column with commentStepCount

3rd with newManual

4th with replacementsManual



Following is the screen shot







So I am using following code.everything is working fine but I am unable to fill the combo-box with property=" sFPBean.languageClassificationCollection".









<c:forEach var = "sFPBean" items = "${requestScope.E1001Form.standardFactorParamBeanList}"

varStatus="status">

<tr class="right">

<td class="blackFontLargeFontAlignCenter"><c ut value="${status.count}" /></td>

<td class="cellWhite cellLessPadding" width="18%">

<html:select property="bareMachine" style="width:100%">

<html ptionsCollection name="E1001Form" property=" sFPBean.languageClassificationCollection" />

</html:select>



</td>

<td class="cellWhite"><input type="text" value='<c ut value="${ sFPBean.commentStepCount}" />'/></td>

<td class="cellWhite"><input type="text" value='<c ut value="${ sFPBean.newManual }" />'/></td>

<td class="cellWhite"><input type="text" value='<c ut value="${ sFPBean.replacementsManual }" />'/></td>

(similarly 6more rows)

</tr>

</c:forEach>



Language cmmnt new rpl

Classification S.Cnt Manual Manual









Instead of this if I make a arraylist of strings in E1001Form itself, and then display here, it is going fine as with the following tag.



<html:select property="bareMachine" style="width:100%">

<html ptionsCollection name="E1001Form" property="languageClassificationCollection " />

</html:select>



My problem is with .How to use <html ptionCollection > inside a <c:forEach>��.kindly help me with some inputs.
 
Sheriff
Posts: 67752
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
As <html:select> is a Struts tag, this has been moved to the Struts forum.
 
And inside of my fortune cookie was this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic