File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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 ]
 
 
subject: How do I fill the radio button value from indexId bean