Hi,
Can Someone help me with this.
Only one value is inserted into the Db when I tried
to use the multiselect listbox and selected multiple values.
I need all the values I select from a listbox to be comma separated and
inserted in the coresponding Db column.
I'm using the java for inserting the data into database.
I've the following:
on Jsp I've like this
<html:select property="vpmoPmt" size="4" multiple="true" tabindex="3" >
<html

ptions collection="pmtlist" property="value" labelProperty="label"/>
</html:select>
On the Form I've the variable defined like this..
private String vpmoPmt[];
In the java code I'm doing this to set the value to insert the data into database table.
String[] vpmoPmt = requestForm.getVpmoPmt();
if (vpmoPmt != null && vpmoPmt.length > 0 ) {
StringBuffer pmt = new StringBuffer();
for ( int i = 0; i < vpmoPmt.length; i++ ) {
if ( pmt.length() > 0 ) {
pmt.append(", ");
}
pmt.append(vpmoPmt[i]);
pimVpmo.setPmt(vpmoPmt[i]);
}
}
Please advise me if I'm doing any thing wrong..
Thanks,
Anil