Hi all,
Hope Im in the right forum!
This is an extract of the file, my problem is:
at the end of this file I collect in the hidden field the list of nextStageList which is fine but I need to get it back at the top of the page for some other reasons; and i don't know how, i thought about the request below but it doesn't work, any ideas?
for testing i call it samepage.jsp so it reload on itself.
request.getParameterValues("nextStageList");
ArrayList nextStageList = new ArrayList();
....
....
....
<form name="f1" action="samepage.jsp" method="post">
<table width=80% bgcolor=white border=1 cellspacing=0 cellpadding=6 align=center>
<tr>
<%
%>
<%= th.format(ItemTypePeer.DESCRIPTION, "Item Type") %>
<%= th.format(SystemPeer.NAME, "System") %>
<%= th.format(ItemPeer.JTD, "JTD") %>
<%= th.format(ItemPeer.TAG, "Tag") %>
<%= th.format(StageTemplatePeer.DESCRIPTION, "Status") %>
<th class=tableheads nowrap>Next Stage</th>
<th class=tableheads nowrap>% Complete</th>
<th class=tableheads nowrap>Bar Graph</th>
</tr>
<%
Iterator i = items.iterator();
while(i.hasNext()) {
double pc;
Item item = (Item) i.next();
if(item.getNextStage().getStageId() == Stage.DONE) {
pc = 100.0;
}
else {
int done = item.getHistory().size();
int total = item.getItemType().getStages().size();
pc = 100.0 * done / total;
}
String nextStage = item.getNextStage().getStageTemplate().getDescription();
nextStageList.add(nextStage);
%>
<tr>
<td class=columnwhite><%=item.getItemType().getDescription()%></td>
<td class=columnwhite><%=item.getSystem().getName()%></td>
<td class=columnwhite><%=item.getJtd()%></td>
<td class=columnwhite><%=item.getTag()%></td>
<td class=columnwhite><%=item.getStage().getStageTemplate().getDescription()%></td>
<td class=columnwhite><%=nextStage%></td>
<td class=columnwhite><%=roundPercentage.format(pc)%>%</td>
<td class=columnwhite width="75">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #000000;">
<tr>
<% if (pc > 0.00001) {%>
<td width="<%=pc%>%" bgcolor="#3333FF"><img src="images/bargrph_spacer.gif" width="1" height="10"></td>
<%}%>
<% if (pc < 100.00000) {%>
<td bgcolor="#CCCCFF"><img src="images/bargrph_spacer.gif" width="1" height="10"></td>
<%}%>
</tr>
</table>
</td>
</tr>
<%
}
%>
<input type=hidden name=nextStageList value="<%= nextStageList %>">
</TABLE>
</form>
Hope Im in the right forum!
This is an extract of the file, my problem is:
at the end of this file I collect in the hidden field the list of nextStageList which is fine but I need to get it back at the top of the page for some other reasons; and i don't know how, i thought about the request below but it doesn't work, any ideas?
for testing i call it samepage.jsp so it reload on itself.
request.getParameterValues("nextStageList");
ArrayList nextStageList = new ArrayList();
....
....
....
<form name="f1" action="samepage.jsp" method="post">
<table width=80% bgcolor=white border=1 cellspacing=0 cellpadding=6 align=center>
<tr>
<%
%>
<%= th.format(ItemTypePeer.DESCRIPTION, "Item Type") %>
<%= th.format(SystemPeer.NAME, "System") %>
<%= th.format(ItemPeer.JTD, "JTD") %>
<%= th.format(ItemPeer.TAG, "Tag") %>
<%= th.format(StageTemplatePeer.DESCRIPTION, "Status") %>
<th class=tableheads nowrap>Next Stage</th>
<th class=tableheads nowrap>% Complete</th>
<th class=tableheads nowrap>Bar Graph</th>
</tr>
<%
Iterator i = items.iterator();
while(i.hasNext()) {
double pc;
Item item = (Item) i.next();
if(item.getNextStage().getStageId() == Stage.DONE) {
pc = 100.0;
}
else {
int done = item.getHistory().size();
int total = item.getItemType().getStages().size();
pc = 100.0 * done / total;
}
String nextStage = item.getNextStage().getStageTemplate().getDescription();
nextStageList.add(nextStage);
%>
<tr>
<td class=columnwhite><%=item.getItemType().getDescription()%></td>
<td class=columnwhite><%=item.getSystem().getName()%></td>
<td class=columnwhite><%=item.getJtd()%></td>
<td class=columnwhite><%=item.getTag()%></td>
<td class=columnwhite><%=item.getStage().getStageTemplate().getDescription()%></td>
<td class=columnwhite><%=nextStage%></td>
<td class=columnwhite><%=roundPercentage.format(pc)%>%</td>
<td class=columnwhite width="75">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #000000;">
<tr>
<% if (pc > 0.00001) {%>
<td width="<%=pc%>%" bgcolor="#3333FF"><img src="images/bargrph_spacer.gif" width="1" height="10"></td>
<%}%>
<% if (pc < 100.00000) {%>
<td bgcolor="#CCCCFF"><img src="images/bargrph_spacer.gif" width="1" height="10"></td>
<%}%>
</tr>
</table>
</td>
</tr>
<%
}
%>
<input type=hidden name=nextStageList value="<%= nextStageList %>">
</TABLE>
</form>