Quantcast
Channel: How to open two windows in response to one click
Viewing all articles
Browse latest Browse all 13

Re: How to open two windows in response to one click

$
0
0

OK.  I tried your solution Rion and it did work - after I allowed popups and the page refreshed and such.  I'm not sure what the customer will think about that.  Probably no biggie but you never know.

But now I looked at that the link that mutantbc posted and came up with this modification:

            //show the siteplan form
            this.graphicAnalysisResource = this.analysisResource + "?projectId=" + this.projectId + "&featureId=" + featureId + "&layerId=" + graphicLayer.layerId;
            var win1 = window.open(this.graphicAnalysisResource);
            win1.focus();

            //show the siteplan drawing
            this.graphicAnalysisResource2 = "/analysis/SubmittalDrawing" + "?projectId=" + this.projectId + "&featureId=" + featureId + "&layerId=" + graphicLayer.layerId;
            var win2 = window.open(this.graphicAnalysisResource2);
            win2.focus();

Which didn't work, but produced an interesting result.  The line 'win2.focus();' throws a null reference exception - it seems win2 is null at that point.  Which makes me wonder what's going on.  The urls actually point to mvc controller functions, which have to fetch data before rendering the views, and it takes a few seconds for the first view to display in the browser.  Not sure if that's affecting things or not.

I see the same behavior on Chrome as well as IE.


Viewing all articles
Browse latest Browse all 13

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>