Hi,
Try this out: In the formBean, instead of an array list, try putting a String
array.
ActionForm:
private String[] listEdad = null;
public String[] getListEdad () {
return listEdad;
}
public void setListEdad (String[] listEdad) {
this.listEdad = listEdad;
}
With best regards,
Anjishnu.
-----Original Message-----
From: José María Tristán [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 07, 2006 8:13 PM
To: [email protected]
Subject: Problem whith a arrayList and a html:option
Hello, Sorry by the text but I speak a little english. I have a problem with
a struts application.
I want capture data to a multiple select. I use a Arraylist into a Bean.
This is a part of my code of the actionform:
private List listEdad = new ArrayList();
public List getListEdad() {
return (this.listEdad);
}
public void setListEdad(ArrayList listEdad) {
this.listEdad = listEdad;
}
And this is part of code of jsp:
<%
List arrayCodigo = new
ArrayList();
List arrayDescripcion = new
ArrayList();
arrayCodigo.add("100");
arrayDescripcion.add("SEDA
Solubles");
arrayCodigo.add("101");
arrayDescripcion.add("Liofilizados");
arrayCodigo.add("102");
arrayDescripcion.add("Cogeneracion");
pageContext.setAttribute("arrayCodigo", arrayCodigo);
pageContext.setAttribute("arrayDescripcion", arrayDescripcion);
%>
<html:form action="submit.do">
ListEdad:
<html:select property="listEdad" multiple="true">
<html:options name="arrayCodigo"
labelName="arrayDescripcion"></html:options>
</html:select>
<html:submit></html:submit>
Then, I select, per example, "Seda Solubles" and "Cogeneracion". The
application never go to setListEdad and never
save the values into listEdad.
Why?
Thank you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are
not to copy, disclose, or distribute this e-mail or its contents to any other
person and any such actions are unlawful. This e-mail may contain viruses.
Infosys has taken every reasonable precaution to minimize this risk, but is not
liable for any damage you may sustain as a result of any virus in this e-mail.
You should carry out your own virus checks before opening the e-mail or
attachment. Infosys reserves the right to monitor and review the content of all
messages sent to or from this e-mail address. Messages sent to or from this
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***