Hi,
I have a listbox in my application and if i gave some value and click on search and the values in the database automatically populate in the textbox and dropdown boxes as well as list box. but in case of list box, as we know in the list box we can select multiple values at a time and can store into the database and in my case, while i click on search, multiple values need to select on the list box automatically. what i did was
[CODE=java]String SqlStrAtOfc = "select distinct(trim(o fi.name)) as office from attendanceuser atr,office ofi where ofi.id=atr.offi ce_id and atr.loginname=' dfsdfg'
ResultSet rs3 = stmt.executeQue ry(SqlStrAtOfc) ;
while(rs3.next( ))
{
for(int i=0;i<rs3.getRo w();i++)
{
strOffice += "<option value=" + "'" + rs3.getString(" office") + "' Selected >" + rs3.getString(" office") + "</option>";
break;
}
}[/CODE]
the above code gives partially results, can anyone please suggest the exact way to implement.
I have a listbox in my application and if i gave some value and click on search and the values in the database automatically populate in the textbox and dropdown boxes as well as list box. but in case of list box, as we know in the list box we can select multiple values at a time and can store into the database and in my case, while i click on search, multiple values need to select on the list box automatically. what i did was
[CODE=java]String SqlStrAtOfc = "select distinct(trim(o fi.name)) as office from attendanceuser atr,office ofi where ofi.id=atr.offi ce_id and atr.loginname=' dfsdfg'
ResultSet rs3 = stmt.executeQue ry(SqlStrAtOfc) ;
while(rs3.next( ))
{
for(int i=0;i<rs3.getRo w();i++)
{
strOffice += "<option value=" + "'" + rs3.getString(" office") + "' Selected >" + rs3.getString(" office") + "</option>";
break;
}
}[/CODE]
the above code gives partially results, can anyone please suggest the exact way to implement.
Comment