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 simple multibox problem - am I going mad? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "simple multibox problem - am I going mad?" Watch "simple multibox problem - am I going mad?" New topic
Author

simple multibox problem - am I going mad?

A Harry
Ranch Hand

Joined: Jan 23, 2002
Posts: 124
I have a bean -

public class ResourceType_DTO
{
long resTypeID;
String resName;

public String getResName()
{
return resName;
}
public void setResName(String resName)
{
this.resName = resName;
}
public long getResTypeID()
{
return resTypeID;
}
public void setResTypeID(long resTypeID)
{
this.resTypeID = resTypeID;
}
}

I set a List of these objects on the request object like so -

request.setAttribute("resTypesList", getResourceTypeList());

I then want to display a checkbox for each ResourceType_DTO object in the list. So the value attribute for each checkbox would be "resTypeID" & the text displayed "resName".

I've tried every combination of <html:multibox> & <logic:iterate> tags I can think of but still can't get this simple task to happen!

Any help please, this is doing my Head in!
Amit Ghai
Ranch Hand

Joined: Mar 24, 2004
Posts: 35
I think this would work.

<logic:iterate id="name" name="resTypeList">
<html:multibox name="Give Action Form Name to get this value further"
property ="Name Of The Field In that Form Here" ><bean:write name="name" property="resTypeId"/></html:multibox><bean:write name="name" property="resName"/>
</logic:iterate>


Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people.
A Harry
Ranch Hand

Joined: Jan 23, 2002
Posts: 124
Cheers Amit, works fine now!
 
 
subject: simple multibox problem - am I going mad?
 
Threads others viewed
XMLEncoder not serializing the whole graph!
html:checkbox or html:multibox
how to map list of object from jsp to command object in spring
Multibox reset method ?
checkbox list in struts 2
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com