Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

html:select indexed - idexes the formbean i.s.o. the property

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I already searched the forum for comparable topics, but in none of them was a solution available.

I'm generating an indexed selectbox for every item in a list (of users). By doing this I want to be able to "evaluate" every user according to the selected values from their respective selectbox.
So far I am able to generate the select boxes, but somehow it doesn't see the property (for the selectbox) as the indexed attribute. The followinng code generates the required list with the selectboxes.

The only problem is that the selectboxes are not correctly indexed. Normally you would expect something like this:
html:select property="formbean.evalId[i]" where evalId contains the index number.
But what I get is html:select property="formbean[0].evalId" where in this case the formbean itself gets indexed.
I implemented the property in the formbean as well as a String[] as a List but I haven't solved the problem yet.
Any ideas on this?
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<bean:define name="formbean" property="evalId" id="evalId"/>
<c:forEach....
...
<html:select name="evalId" indexed="true">
...
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Marc Peabody:
<bean efine name="formbean" property="evalId" id="evalId"/>
<c:forEach....
...
<html:select name="evalId" indexed="true">
...



Thanks for your reply Marc. One problem: html:select property is required attribute. so what do I put there then?

Update:
When I use nested tag for selectbox, it's getting rendered as <select name="evalId"> where evalId gets filled with all the values gathered from all the selectboxes that are generated. So this way I can go further.
And the problem I had with indexed formbean appears to be the normal outcome when using indexed selectbox. The question remains on getting the data if it's supposed to be that way (since evalId returns null).
[ September 29, 2005: Message edited by: Ergin Er ]
 
What? What, what, what? What what tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!