we ran into a similar problem. We had to keep a value a user entered if they
used the back button or left that area of the site and returned later. The
only way we could solve it was using java script to check if the bean we
stored our values in was empty or not. if the bean is not empty we load the
values from the bean if it is empty we use cache. I'm not sure if you are
using a session variable or not but I have included some code that you can
look at and see if it will work for you. This page deals primarily with
check boxes so that is what most of the references are to. We then decide
what to show based on what was selected. good luck.
//--------------------------------------------------------------------------
------------------------
function initializePage() { // ***
Initialization executed when page is opened
//--------------------------------------------------------------------------
------------------------
if ( userBrowser == 'Microsoft Internet Explorer' ) {
curDocForm = document.fedTaxForm;
} else {
// *** div FormContent defined in
curDocForm = document.FormContent.document.fedTaxForm; //
*** incDataFormDivOpen.jsp
}
var rbSelected = false;
<!-- Restore data from cache, if available -->
for ( x=0 ; x < 3 ; x++ ) {
if ( curDocForm.fedTax[x].checked ) {
rbSelected = true;
break;
}
}
<!-- If no cache data restored, check Bean for data to restore -->
if ( ! rbSelected && '<%=PTWHOption%>' != '' ) {
setOptionsFromBean();
}
return true;
}
/---------------------------------------------------------------------------
-----------------------
function setOptionsFromBean() {
//--------------------------------------------------------------------------
------------------------
var myIndex = -1;
if ( '<%=PTMaritalStatus%>' == 'S' ) {
myIndex = 0;
} else if ( '<%=PTMaritalStatus%>' == 'M' ) {
myIndex = 1;
} else if ( '<%=PTMaritalStatus%>' == 'MH' ) {
myIndex = 2;
}
<% if ( PTWHOption.equals("N") ) { %>
curDocForm.fedTax[0].checked = true;
<% } else if ( PTWHOption.equals("P") ) { %>
curDocForm.fedTax[1].checked = true;
curDocForm.fedAllow1.value = '<%=PTAllowanceNum%>';
curDocForm.selectMar1.selectedIndex = myIndex;
<% } else if ( PTWHOption.equals("PA") ) { %>
curDocForm.fedTax[2].checked = true;
curDocForm.fedAllow2.value = '<%=PTAllowanceNum%>';
curDocForm.fedAdditDisp.value = '<%=PTFixedAmount%>';
curDocForm.selectMar2.selectedIndex = myIndex;
<% } %>
return true;
}
-----Original Message-----
From: Adress, David S. [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 08, 2000 8:29 AM
To: JRun-Talk
Subject: $20 bucks to the 1st person who actually solves my problem!!!
I am on this for days and I can't figure out what I'm doing wrong. I will
send $20 bucks to 1st person who actually solves my problem.
I am using jsp page's to control the layout of my page and servlets to spit
back
table data or to do database transactions.
I have a jsp page that displays a list of employees. The jsp page
has an include statement to include the servlet to spit out the table.
The jsp just handles the general look of the page and the servlet just
spits out the table and table html tags. Next to each record I have an add
and
delete hyperlink. If someone clicks the add link it displays another page to
add
an employee and then the action servlet adds the record and then goes back
to the jsp
list page. If some one deletes a record it calls a servlet to delete and
then the servlet redirects back to the jsp list page. But the list doesn't
display the updated data without having me hit the refresh button in the
browser.
I tried using Tomcat and now am using Jrun and am still having the same
problem.
I've included all the proper meta tags in the jsp list page not to cache but
it's not working. I've also tries doing it with reponse.setHeader but it
doesn't work either.
I've tried sending a random number param to the page
ShowList?rnd=Randomnumber it still doesn't work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide
more resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists