• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

drop down list: on refresh page by default select option is not coming

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,
In work wise progress report Jsp page, drop down list is there. If i select anyone town name(in list out of 215 town names), it ll display report. After viewing report. i refreshed tat page(ie., it does not go to default "SELECT" option instead, it takes the same city name that i used to check previous report).

For this project i used struts 1.2 & jsp.
please check following code :

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
import="java.sql.*,java.text.DecimalFormat" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>

<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<bean:define id="reportModel" name="JSPView"
type="in.gov.mrc.kstd.business.ReportModel" />


<%@page import="in.gov.mrc.kstd.business.WorkwiseProgressReport"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Workwise Progress Report</title>
</head>


<script language="javascript">

function fnFetchData()
{
document.WorkDetailForm.action="/CMSMTDP/generateWorkwiseProgressReport.do?dispatch=workwiseProgressReport";
document.WorkDetailForm.submit();
}

function fnClose()
{
document.location.href="/CMSMTDP/close.do";
}

function fnExport()
{
document.location.href = "/CMSMTDP/export-excel.do?tilesPath=.mrc.exportWorkwiseProgressReport";
}

</script>

<body bgcolor="FFFFCC">

<html:form action="/generateWorkwiseProgressReport.do" method="post">
<table border="0" cellpadding="2" align="center" >

<tr>
<td colspan="7" align="center" class="reportcolumnheader">Town:<html:select property="ulb.ulbId" name = "reportModel" onchange="fnFetchData()">


<logic:notEmpty property = "ulbList" name = "reportModel">
<html:option value="-2">Select</html:option>
<html:option value="-1">All</html:option>
<bean:define id="ulbLst" property="ulbList" name="reportModel"/>
<html:options collection ="ulbLst" property="ulbId" labelProperty="ulbName"/>
</logic:notEmpty>

</html:select> </td>
</tr>
</table>
<logic:equal property="showReportFlag" name="reportModel" value="true">
<table border="1" cellpadding="2" align="center" >

<tr>
<td colspan="13" align="center" class="reportcolumnheader">Workwise Progress Report</td>
</tr>
<tr>
<td colspan="13" align="right" height="5px">
<span style="font-size:10px;font-weight: bold">Rs in Lakhs</span>
</td>
</tr>

<tr>
<td class="reportcolumnheader">S.No</td>
<td class="reportcolumnheader">Town Name</td>
<td class="reportcolumnheader">SectorName</td>
<td class="reportcolumnheader">Package</td>
<td class="reportcolumnheader">Work Code</td>
<td class="reportcolumnheader">WorkName</td>
<td class="reportcolumnheader">Contractor/Entrusted Agency Name</td>
<td class="reportcolumnheader" width="70px">Commencement Date </td>
<td class="reportcolumnheader" width="70px">Target Date</td>
<td class="reportcolumnheader">Work Completion Date</td>
<td class="reportcolumnheader">Contract Amount</td>
<td class="reportcolumnheader">Estimate Cost</td>
<td class="reportcolumnheader">Expenditure Cost</td>

</tr>

<logic:empty property="workwiseProgressReportList" name="reportModel">
<tr ><td colspan="13" align="center" ><span style="font-size:10px;font-weight: bold">No records found</span></td></tr>
</logic:empty>
<%
double contractAmountTotal=0;
double estimateCostTotal=0;
double expenditureCostTotal=0;
int sNo=0;
%>

<logic:notEmpty property="workwiseProgressReportList" name="reportModel">
<logic:iterate id="workwiseProgressReport" property="workwiseProgressReportList" name="reportModel">
<tr>

<%!String contractTotal = null;
String estimateTotal = null;
String expenditureTotal = null;
%>

<%
WorkwiseProgressReport work=(WorkwiseProgressReport) workwiseProgressReport;
int ulbGroup=work.getUlbGroup();
int sectorGroup=work.getSectorGroup();

DecimalFormat df = new DecimalFormat("#0.00");

contractAmountTotal=contractAmountTotal+work.getContractAmount();
contractTotal = df.format(contractAmountTotal);

estimateCostTotal=estimateCostTotal+work.getEstimateCost();
estimateTotal = df.format(estimateCostTotal);

expenditureCostTotal=expenditureCostTotal+work.getExpenditureCost();
expenditureTotal = df.format(expenditureCostTotal);

sNo++;
%>
<td class="reportcolumnLabel"><%=sNo %></td>
<td class="reportcolumnLabel"><bean:write property="ulbName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="sectorName" name="workwiseProgressReport"/></td>

<td class="reportcolumnLabel"><bean:write property="packageCode" name="workwiseProgressReport"/></td>
<% String workCodeStr=work.getSectorCode()+"/"+work.getPackageCode()+"/"+work.getWorkCode();
%>
<td class="reportcolumnLabel"><%=workCodeStr %></td>
<td class="reportcolumnLabel"><bean:write property="workName" name="workwiseProgressReport"/></td>
<td class="reportcolumnNumber"><bean:write property="contractorentrustedagencyName" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="commencementDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnLabel"><bean:write property="targetDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="workCompDate" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="contractAmount" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="estimateCost" name="workwiseProgressReport"/> </td>
<td class="reportcolumnNumber"><bean:write property="expenditureCost" name="workwiseProgressReport"/> </td>
</tr>
</logic:iterate>

<tr>
<td colspan="10" align="right" class="reportcolumnheaderRight"> Grand Total:</td>
<td class="reportcolumnheaderRight" align="right"><%=contractTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=estimateTotal %></td>
<td class="reportcolumnheaderRight" align="right"><%=expenditureTotal %></td>
</tr>

</logic:notEmpty>
</table>

<table align="center" border="0" >

<tr><td colspan="13" align="center"><input type="button" value="Close" class="button" onclick="fnClose()"/>
<input type="button" value="Save As Excel" class="button" onclick="fnExport()"/></td>



</tr>
</table>
</logic:equal>
</html:form>

</body>
</html>
workwiseprogress.jpg
[Thumbnail for workwiseprogress.jpg]
workwise progress report screens
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic