Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old October 6th, 2008, 12:43 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I doubt it's fair to blame Microsoft for this. If I understand your problem correctly, this problem is largely caused by the loosely coupled, disconnected and stateless nature of the web in general, not because of the way Microsoft have implemented .NET....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
  #12 (permalink)  
Old October 6th, 2008, 12:45 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Nope, the meta tag refresh also loses the selection form field values when the refresh occurs. I'll have to find some other work around.

Thanks!
  #13 (permalink)  
Old October 6th, 2008, 12:47 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Imar,

Sorry, you're right (although MS is to blame for 95% of the worlds woes, of course, even those not involving computers). :D
  #14 (permalink)  
Old October 6th, 2008, 03:26 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

For inquiring minds, the closest I was able to get was to force a refresh after the records are saved. And even that work-around nearly caused a brain aneurysm, as it was necessary to use a Response.Write in the code-behind to pass the reload script to the Submission Form returned once the updates are completed.

If anybody has a suggestion that does not require changing my page from METHOD=POST to METHOD=GET, I'm still interested in a more elegant solution.

Thanks!
  #15 (permalink)  
Old October 6th, 2008, 04:38 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So a simple question to you:

Do you have an <asp:button> on that page that will, effectively, refresh it???

That is, how are you having your users refresh it now? If they hit the browser REFRESH (F5), they will get that same "resubmitting post data" message (yes, in *any* browser...message differs, but it's a security measure that browsers are *supposed* to implement, just so that evil scripters can't do bad things). So when you posted your original message, did you have a scheme in mind for allowing people to refresh without needing to hit F5? Hopefully, some <asp:button>???

If so, then just have the code "push" that same button, instead of doing the reload() call.

That is:
    window.opener.document.forms[0].nameOfThatButton.click();
or
    window.opener.document.getElementById("id of that button").click();

If you don't have such a button, could you create one?

Note that you could even hide the button from the user, if you wanted, using an appropriate style. Just make sure it posts the correct info back to the server to refresh the data on the page.
  #16 (permalink)  
Old October 6th, 2008, 04:40 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

And you probably already discovered this by now, but...
    "...I was not aware that IE kept track of which windows were opened by which other browser windows..."

Not just IE. All browsers, that I know of. Possibly excepting some of the old text-only browsers.
  #17 (permalink)  
Old October 7th, 2008, 02:04 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

The dialogue box about resending the info means that a post was involved when the page was created. Have you tried:
Code:
opener.location.href = opener.location.href
--

Joe (Microsoft MVP - XML)
  #18 (permalink)  
Old October 7th, 2008, 08:08 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Old Pedant:

There was no button originally, although I tried going that route as well as many other solutions I stumbled across on the web. There appeared to be no difference between coding a button, a function, or clicking F5 - it still displayed that *&^%$ dialog box. So calling the button, hidden or not, still forces the users to click yet another button, and our users dislike having to click even one button. Automatically refreshing on update works as effectively, although I consider it an incomplete solution. At least the report disappears and the users HAVE to do something to get it back, unlike the way it was, where they weren't even bothering to refresh despite urging them to frequently do so. If I could get it to submit the refresh ONUNLOAD, I'd have done that instead, but it kept telling me that the window object didn't exist so I gave up going that route.

While some of our users are undoubtedly evil, most of them are just ignorant, and ALL of them are identifiable, because this is an INTRANET site with no external access. Furthermore, we are a gov't agency with the authority to legally punish any employees out to hack our system. It's therefore very unlikely that anybody would submit anything to screw with the system and this "security feature" is clearly unnecessary in our environment (and I would think others maintaining Intranet sites would have a similar issue). There really ought to be a way to submit a refresh and override that unnecessary dialog in such circumstances, but I expect I am singing to the choir when it comes to the many limitations associated with developing web applications. Hello, W3C?

joefawcett:

I tried that, too. Problem with setting href is that the report was no longer able to read the report selection form fields using request.form. Resetting the href value appears to redirect rather than refresh, losing that magical connection between browser windows that Old Pedant pointed out to me. And it can't build the report if I don't know what the user was looking for. I can't switch to GET because the amount of data passed between the pages exceeds the url maximum length (another unfortunate and arbitrary limitation, imho). Cookies have a similar limitation, and our server seems unable to hold onto sessions long enough to rely upon session variables.
  #19 (permalink)  
Old October 7th, 2008, 10:19 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Okay, in that case the only thing I can suggest is to store all the values that were sent in the post in the page. Then have a function that reposts this data to the server when you need to refresh the page.

--

Joe (Microsoft MVP - XML)
  #20 (permalink)  
Old October 7th, 2008, 10:24 AM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

I considered that option, too. I would have to make some pretty significant changes to this program to do this, though, and I simply do not have the time to rewrite it. The half-assed work around will have to do.

Thanks!




Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal report Freeze detail section. dpkbahuguna Beginning VB 6 0 August 23rd, 2007 05:29 AM
Change size of the Detail section of Forms/Report sinajs Access 1 February 13th, 2007 01:05 PM
Shrink Detail section on a report TimLB Access 2 January 23rd, 2007 08:45 AM
Access Report Detail lgpatterson Access 2 January 31st, 2005 08:19 PM
Formatting Report Detail Section rickf Access 3 February 3rd, 2004 07:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.