hi
I've been tasked with changing the below code so that the menu boxes interact. They are task and subtasks (if the task has a subtask). It is a means to edit existing tasks - edit portion complete. I'm looking for a way to pull this info out of an Oracle db, first by task which has a dropdown and a "Go" to jump to that task to edit and also display any subtasks that may belong to the task, if any. The subtask needs a dropdown and "Go" button also. If there aren't any subtasks for the selected task, I need the subtask window not to be displayed.
As the tasks are pulled by dept id, there should not be that many entries and maybe an array (pulling all of the dept tasks and subtasks over at once) would be better than a onChange refresh when the task is selected. My SQL,jsp,java (everything I need to know:)) is very limited. Any advice would greatly be appreciated.
Currently this code shows all the tasks and subtasks from a particular DeptID in drop down menus without any correlation between the task and its subtask.
Please give as much code and explanations as possible.
thanks in advance for any assistance and guidance concerning this matter.
<body marginwidth="0" marginheight="0" topmargin="10" leftmargin="10" bgcolor="#FFFFFF">
<%
String _username = (String) session.getAttribute("user
");
String _deptid = (String)session.getAttribu
te("deptid
");
if (_username == null) {
out.print("<script language=\"javascript\">")
;
out.print("top.location.hr
ef = \"loginfail.jsp\";");
out.print("</script>");
}
// String deptid = request.getParameter("dept
id");
String Dept = StatusSqlBean.returnDeptNa
me(_deptid
);
%>
<%
String reqgroupproj[][] = StatusSqlBean.getGroupProj
ects(_dept
id);
String groupsubproj[][] = StatusSqlBean.getGroupSubP
rojects(_d
eptid);
%>
<div align="left"> </div>
<div align="left">
<form action="task_edit.jsp" method="post">
<table border="0" width="565" cellspacing="0" cellpadding="0" height="20">
<tr>
<td width="1">
<p align="right"><font size="3" face="Arial"></font>
</td>
<td><font size="2" face="Arial"><b>Status Central: </b>Edit Task - <%= Dept%></font></td>
</tr>
<tr><td><input type="hidden" name="department" value="<%= Dept%>"></td></tr>
<tr>
<td width="1" height="2"> </td>
<td height="19">
<hr>
</td>
</tr>
<tr>
<td width="1" height="19"> </td>
<td height="19"><font face="Arial" size="2">Select Project to Edit:</font></td>
</tr>
<tr>
<td width="1"> </td>
<td><font face="Arial" size="2">
<select name="TSKID">
<%
for (int i = 0; i < reqgroupproj.length; i++) {
%>
<option value="<%= reqgroupproj[i][0] %>"> <%= reqgroupproj[i][1] %> </option>
<%
}
%>
</select>
</font></td>
</tr>
<tr>
<td width="1"> </td>
<td> </td>
</tr>
<tr>
<td width="1"> </td>
<td>
<input type="submit" value="Submit" name="submit">
</td>
</tr>
</table>
</form>
</div>
<div align="left">
<br><br>
<div align="left"> </div>
<div align="left">
<form action="task_edit.jsp" method="post">
<input type=hidden name=subtask value=y>
<input type=hidden name=master value=n>
<table border="0" width="565" cellspacing="0" cellpadding="0" height="20">
<tr>
<td width="1">
<p align="right"><font size="3" face="Arial"></font>
</td>
<td><font size="2" face="Arial"><b>Sub Tasks </b></font></td>
</tr>
<tr><td><input type="hidden" name="department" value="<%= Dept%>"></td></tr>
<tr>
<td width="1" height="2"> </td>
<td height="19">
<hr>
</td>
</tr>
<tr>
<td width="1" height="19"> </td>
<td height="19"><font face="Arial" size="2">Select Sub Task to Edit:</font></td>
</tr>
<tr>
<td width="1"> </td>
<td><font face="Arial" size="2">
<select name="SUBID">
<%
for (int i = 0; i < groupsubproj.length; i++) {
if (groupsubproj[i][2] != "") {
%>
<option value="<%= groupsubproj[i][2] %>"> <%= groupsubproj[i][3] %> </option>
<%
} }
%>
</select>
</font></td>
</tr>
<tr>
<td width="1"> </td>
<td> </td>
</tr>
<tr>
<td width="1"> </td>
<td>
<input type="submit" value="Submit" name="submit">
</td>
</tr>
</table>
</div>
<div align="left">
</form>
</div>
</body>
</html>