[CLOSED] Send Params to window

  1. #1

    [CLOSED] Send Params to window

    Hi,

    I want to open a window and send parameters to it.
    The code that I use works with Ext.net 1.3, but when I tried to switch to version 2, I can't receive the parameter.
    Please find below my code:

    Parent page:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Parent.aspx.cs" Inherits="MyProject.WindowGridPanel.Parent" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <script language="javascript" type="text/javascript">
            function showWindow() {
                var win = myResource.employeeWindow;
                win.loader.params.txtToSend = myResource.text.getValue();
                alert(win.loader.params.txtToSend);  // I get the text with the right value!!
                win.show(); // The window opens !!
            }
    
        </script>
        <title></title>
    </head>
    <body id="Body1" runat="server">
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="myResource" />
           
            <ext:Button ID="Button1" runat="server" Text="open window">
                <Listeners>
                    <Click Handler="showWindow()" />
                </Listeners>
            </ext:Button>
            <ext:TextArea ID="text" runat="server">
            </ext:TextArea>
        </div>
        </form>
        <ext:Window ID="employeeWindow" ClientIDMode="Static" runat="server" Resizable="false"
        Icon="ApplicationFormEdit" Width="380" Height="330" Hidden="true" Modal="true"
        Constrain="false">
        <Loader Mode="Frame" ID="Loader1" runat="server" AutoLoad="true" Url="child.aspx">
            <Params>
                <ext:Parameter Mode="Value" Name="txtToSend" />
            </Params>
        </Loader>
    </ext:Window>
    </body>
    
    </html>
    Child parent ( window's page)
     protected void Page_Load(object sender, EventArgs e)
    {
                string selectedIds = Request.QueryString["txtToSend"]; // selectedIds is empty !!
    }
    Last edited by Daniil; Sep 18, 2012 at 12:46 PM. Reason: [CLOSED]
  2. #2
    Hi,

    A load request with empty parameter is already made before Window showing.

    So, when you call the show method, no request occurs.

    I would suggest you to:

    1. Set
    AutoLoad="false"
    for the Loader.

    2. Change your function to:
    function showWindow() {
        var win = myResource.employeeWindow;
    
        win.show();
        win.load({
            params: {
                txtToSend : "hello!"
            }
        });
    }
    If you need the Window to be reloaded on each showing you can configure the Loader in a respective way setting its TriggerEvent and ReloadOnEvent properties.

Similar Threads

  1. Params with <% %> tags
    By norphos in forum 1.x Help
    Replies: 1
    Last Post: May 20, 2011, 3:53 AM
  2. [CLOSED] Window AutoLoad Params
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 19
    Last Post: Sep 09, 2009, 3:05 PM
  3. [CLOSED] AutLoad.Params not working with Window
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 03, 2009, 5:54 PM
  4. Autoload.Params bug
    By Kaido in forum 1.x Help
    Replies: 1
    Last Post: Jun 16, 2009, 4:57 PM
  5. Autoload params ???
    By heysol in forum 1.x Help
    Replies: 2
    Last Post: Apr 02, 2009, 1:24 PM

Posting Permissions