Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

check boxes functionality in struts

 
surya gond
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Description of the problem:
I have a form which will display rows (Eg 100) with two columns ("vehicleDescription" and "leaseAmount"). This form should display empty (unchecked) boxes for all the 100 rows on left side. This form also has a "Delete" button. Whenever a user wants to delete some displayed rows, user selects check boxes associated with that rows. When the user clicks the Delete button, only those rows with checked boxes, should be retrieved in action class to be passed to delete method.



This is what I have in jsp page
<logic:iterate id = "vehicleLeaseListrowid" name="vehicleLeaseList"
scope = "request" type ="com.lvm.vehicle.server.data.VehiclesLeaseValueBean">
<tr>
<td><html:multibox property="selections"><bean:write name="vehicleLeaseListrowid" property="vehicleId"/></html:multibox></td>
<td class="lblBlk1"><bean:write name = "vehicleLeaseListrowid" property = "vehicleDescription"/></td>
<td class="lblBlk1"><bean:write name = "vehicleLeaseListrowid" property = "leaseAmount"/></td>
</tr>



This is what I have in actionform
private String[] selections = {};

public void setSelections(String[] selections){
this.selections = selections;
}

public String[] getSelections(){
return this.selections;
}



This is what I have in reset method
selections = null;



This is the exception error I am facing:
SRVE0026E: [Servlet Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1650)
at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1545)
at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1574)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:919)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726)



Please let me know if any more information is needed??
Can some body please help me??

Thank You
Surya
[ September 28, 2004: Message edited by: surya gond ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic