Selection graphic disappearing with tabbed browsing

759
7
08-01-2011 12:15 PM
PaigeBaldassaro
New Contributor
I have a map with selection graphics added to them via Javascript. when the user clicks on the submit button, a new window is added based on the selection. If the user then tabs back to the original map, the selection graphics disappear. I don't understand why. Any ideas?
Paige
0 Kudos
7 Replies
derekswingley1
Frequent Contributor
That does sound strange...can you post your code to reproduce this? Maybe on jsfiddle?
0 Kudos
PaigeBaldassaro
New Contributor
Ok, I've never used JSFiddle before. But it looks awesome. I may have to use it from now on! I think this is the link to the JS code. http://jsfiddle.net/Soutti/PZt2C/

Also, to see it in action, go here.  www.cmiweb.org/fia/userlogin.aspx. Use Guest@my.xxx Guest123 as the login credentials.

Paige
0 Kudos
derekswingley1
Frequent Contributor
I'm not an ASP.NET expert but I do know that when you click your submit button it's doing a POST which which reloads the page. This is why your selection is being cleared.
0 Kudos
PaigeBaldassaro
New Contributor
Ok, I thought that by controlling the on click event via javascript, it wouldn't actually post the page. My bad. thanks.
0 Kudos
derekswingley1
Frequent Contributor
You probably can handle it with JavaScript, try this:
//Handles the click event of the submit button.
function openReport(evt) {
    dojo.stopEvent(evt);
    try {
        var URL = "Report.aspx?" + dojo.byId("SearchParameters").value;
        window.open(URL); 
    }
    catch (e) {
        errorHandler(e);
    }
}
0 Kudos
PaigeBaldassaro
New Contributor
Oh, yes, prefect! Thank you!
0 Kudos
derekswingley1
Frequent Contributor
Glad I could help!
0 Kudos