File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Dynamic select list with JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dynamic select list with JSP" Watch "Dynamic select list with JSP" New topic
Author

Dynamic select list with JSP

Rosa Thimerman
Greenhorn

Joined: Mar 30, 2001
Posts: 4
Hello, everybody,
I need to build dynamic select list within a table.
the size of this selection will depend on userlogin permission.
I need be able to have my selection box size same as my table.
option value should come dynamicaly as well as option name.
Please, help
Ghazanfar Qureshi
Greenhorn

Joined: Nov 15, 2000
Posts: 20
<table>
<tr>
<td><form method="post" name="" action="">
<select name="mySelect" STYLE="width:80px">
<%
//suppose u ve an array of permission and array of
// value or numeric id matching at respective index

String perm[] =new String[10];
int permid[] =new permid[10];
// some how u fill both the arrays from database or hard-coded
//it depends on you
for (int i=0; i< perm.length; i++){
%>
<option value="<%=permid[i] %>"><%= perm[i] %></option>
<%
}
%>
</select></form>
</td>
</tr>
</table>

for fixed width i used the style sheet tag it wont run on olser browser
regards
Ghazanfar Qureshi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic select list with JSP