I am using a multi select dropdown which is populated dynamically. How do I retrieve all the selected values from the dropdown list? I am using struts and here is the code from the JSP.
<html:select= name="HForm" property="selPerson" multiple="multiple">
<logic:iterate id="pplist" name="HForm" property="personList">
<option value=<bean:write name="pplist" property="id"/>><bean:write name="pplist"
property="value"/></option>
</logic:iterate>
</html:select>
Currently I am trying to retrieve the selected values by using the below method on the form object, but this returns all the values from the dropdown. I only need the ones selected by the user.
hform.getPersonList
Form oject: HForm.java
private List personList=new ArrayList();
private List selPerson=new ArrayList();
I tried using hmf.getselPerson();
but this throws an error:
PropertyUtils E org.apache.commons.beanutils.PropertyUtilsBean invokeMethod Method invocation failed.
java.lang.IllegalArgumentException: argument type mismatch