Flex 4 将变量发送并加载到新窗口

发布于 2024-12-01 02:10:01 字数 649 浏览 2 评论 0原文

我想将一些变量发布到新窗口。

然后,接收 c# 将生成一个 CSV,该 CSV 将作为下载进行流式传输。

在 flex 中,这通常是使用 loadVars 并指定 _blank 作为目标来实现的。

我目前使用以下内容:

            var myRequest:URLRequest = new URLRequest(url);
            var myLoader:URLLoader = new URLLoader();
            var myVariables:URLVariables = new URLVariables();

            myVariables.CurrentActiveUserID = currentUserID
            myVariables.ReportRuleListID = SingleChartID

            myRequest.method = URLRequestMethod.POST;
            myRequest.data = myVariables;
            myLoader.load(myRequest);

但它似乎不支持以新窗口为目标。

任何想法。

请并谢谢你。

I want to post some variables to a new window.

The receiving c# will then generate a CSV which will stream as a download.

In flex this used to be achieved using loadVars and specifying _blank as the target.

I currently use the following:

            var myRequest:URLRequest = new URLRequest(url);
            var myLoader:URLLoader = new URLLoader();
            var myVariables:URLVariables = new URLVariables();

            myVariables.CurrentActiveUserID = currentUserID
            myVariables.ReportRuleListID = SingleChartID

            myRequest.method = URLRequestMethod.POST;
            myRequest.data = myVariables;
            myLoader.load(myRequest);

But it does not seem to support targeting of new windows.

Any ideas.

Please and thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

才能让你更想念 2024-12-08 02:10:01

我最终将其排序为:

    private function sendAndLoadCSVData():void {
            var swfURL:String = this.loaderInfo.url;
            swfURL = swfURL.substr(0,swfURL.lastIndexOf("/") + 1);
            var tempDom:Array = swfURL.split("/");
            var domURL:String = tempDom.slice(0,3).join("/") + "/";
            var url:String = swfURL + "../Reporting/ExportChartCSV.aspx"

            // var post_variable:LoadVars = new LoadVars();

            var myRequest:URLRequest = new URLRequest(url);
            var myLoader:URLLoader = new URLLoader();
            var myVariables:URLVariables = new URLVariables();

            myVariables.CurrentActiveUserID = currentUserID
            myVariables.ReportRuleListID = SingleChartID

            myRequest.method = URLRequestMethod.POST;
            myRequest.data = myVariables;
            navigateToURL(myRequest, '_blank')
            //myLoader.load(myRequest);

        //  Alert.show(url);


        }

I finally sorted it with:

    private function sendAndLoadCSVData():void {
            var swfURL:String = this.loaderInfo.url;
            swfURL = swfURL.substr(0,swfURL.lastIndexOf("/") + 1);
            var tempDom:Array = swfURL.split("/");
            var domURL:String = tempDom.slice(0,3).join("/") + "/";
            var url:String = swfURL + "../Reporting/ExportChartCSV.aspx"

            // var post_variable:LoadVars = new LoadVars();

            var myRequest:URLRequest = new URLRequest(url);
            var myLoader:URLLoader = new URLLoader();
            var myVariables:URLVariables = new URLVariables();

            myVariables.CurrentActiveUserID = currentUserID
            myVariables.ReportRuleListID = SingleChartID

            myRequest.method = URLRequestMethod.POST;
            myRequest.data = myVariables;
            navigateToURL(myRequest, '_blank')
            //myLoader.load(myRequest);

        //  Alert.show(url);


        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文