Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Refreshing frame containing xls table?  RSS feed

 
Lon Allen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP that contains 2 frames. An upper frame contains two select lists to allow the user to select a range of data to be displayed in the lower frame (Initially the lower frame is a "blank" page since nothing has been submitted yet). Once the user selects the "start" and "end" indices to be displayed in the lower frame and selects the submit button I format some data returned by a bean to display in a table in the lower frame. If the submit button is selected again, regardless of whether or not the indices are changed the table data is redisplayed with the correct data.
I changed the contentType to "application/vnd.ms-excel" to display the table in excel instead of HTML. The problem I am having is that if I re-submit the form by selecting my Submit button again the lower frame goes blank and I cannot get the excel table to display again. I have to force the entire page to be refreshed from scratch to be able to bring the data into view again. This causes the user to have to reselect start and end indices again and then selecting submit.
Any clues as to why I can't resubmit the data to be displayed? When I have the contentType as "text/html" changing the indices and re-submitting works fine, I just can't get it to work when the contextType is for excel.
TIA
Lon Allen
 
Lon Allen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should note that this is occurring with IE 6.0. If I run this in Netscape, instead of the xls spreadsheet being displayed in the lower frame an excel window is opened and the spreadsheet is displayed there. If I change the indices for the table in the upper frame and select Submit again a new spreadsheet is opened into the excel window along with the first displaying the new data.
Lon Allen
 
Lon Allen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a little more info:
When IE6 saves the table as an xls file it always sets the filename to the same thing (ie. myjsp.jsp.xls). Whereas Netscape keeps a count of how many times the table has been opened and adds an increment to the filename each time (ie. myjsp.jps-1.xls, myjsp.jsp-2.xls...). It appears that when I display the initial xls file in the lower frame of my web page some kind of a handle or object name (maybe the xls filename for all I know) is created. When I change the data indices and try to redisplay the table/xls only a blank page is displayed. It is like the browser thinks the page is already there and doesn't attempt to display it.
I am thinking that I am having the notorious cache problem with IE6 and can't find anyway to fix it. Trying to set the following has no effect:

Lon
[ May 28, 2003: Message edited by: Lon Allen ]
 
Deb Williams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a similar issue. I have a JSP that opens an excel spreadsheet and displays data. It works fine the first time. However, if I return to that JSP within the same session, the data from the original visit is displayed rather than the new data. In fact, the browser appears to open the page directly from cache without going through the code on the JSP page.
Any ideas would be appreciated.
Deb
 
Deb Williams
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is related to the way I am moving to the excel page. I am using a button with a JavaScript onclick function. If I use a jsp forward instead, the excel page displays. Also, this is not Excel related, because my data would not refresh even when I switched from excel to a simple html table. Can anyone explain why this is happening?
I can recode to use forwards; however, the onClick would have been much cleaner - that is if it had worked.
Thanks,
Deb
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!