wood burning stoves 2.0*
The moose likes Struts and the fly likes How do I fill the radio button value from indexId bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How do I fill the radio button value from indexId bean" Watch "How do I fill the radio button value from indexId bean" New topic
Author

How do I fill the radio button value from indexId bean

Simon Birch
Greenhorn

Joined: Dec 26, 2003
Posts: 21
I'm trying to produce a list of items in a page by iterating over a List of those items. As long as I don't try to use a radio button, the list works fine. Unfortunately, the radio button is somewhat essential.

Here is a snippet of the code from the Action (by the way reportName is a misnomer at the moment - it's supposed to be the report index number)


The page contains the following:


With this code, I get a JSP compilation error appearing in the web page.



I've tried using an ordinary <input> tag with the same bit of script used in the html:radio tag above - and it lists fine, but doesn't initialise the radio button.

I must be doing something daft - but I've no idea what it is. Can anyone point me in the right direction (or even solve the problem!).

Thanks in advance.

[ Jess added new lines in the error message so the screen doesn't get stretched too far ]

[ January 24, 2005: Message edited by: Jessica Sant ]
[ January 24, 2005: Message edited by: Simon Birch ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Try this:
<td><html:radio name="reportDefinition" property="reportName" value='<%= indexNumber %>'/></td>


A good workman is known by his tools.
Simon Birch
Greenhorn

Joined: Dec 26, 2003
Posts: 21
Thanks for your reply Marc. Unfortunately, when I tried that, I got an almost identical error to the one I posted previously. Here it is (with line breaks this time )


Does this point to me doing something daft that is preventing the <%=indexNumber%> from working?
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Doh! It's looking for a String, not an Integer.

Try
'<%= indexNumber.toString() %>'
[ January 24, 2005: Message edited by: Marc Peabody ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I fill the radio button value from indexId bean
 
Similar Threads
Radio Button values
help with html radio tag
Logic iterate and vo
Arraylist in JSP with Html radio
Html Radio buttons and Arraylist