struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guido <gui...@ribera.tel.uva.es>
Subject Re: Multi-Select List Box
Date Sat, 01 Feb 2003 17:58:45 GMT
Can anyone post a sample?  I don't know how to set the indexed properties.

If I do:

public void setSelectBox(int index, String item) {
   selectBox[index] = item;
}

i can get a NullPointerException or an ArrayIndexOutOfBoundsExceptions
because I don't know selectBox array size...

What is the best practice to do it??

1. Using a Collection (is not allowed in JavaBeans specification)
2. Increasing dynamically the array size in the setSelectBox method (maybe
too tricky ?).

Thank you very much.

David Graham wrote:
> Define a String[] in your form bean with the same name as your select
box.
>
> David
>

------------------------------------------------------------------------
Guido Garcia Bernardo
guigar@ribera.tel.uva.es
palmerabollo@hotmail.com
                                        "stat rosa pristina
                                nomine, nomina nuda tenemus."
------------------------------------------------------------------------
http://members.ud.com/services/teams/team.htm?id=D8624419-BFB6-4772-A01A-0045631F979F

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message