[CLOSED] Getting the parameter defined in ext:Window Loader

  1. #1

    [CLOSED] Getting the parameter defined in ext:Window Loader

    Hi!

    I am creating my Form Details as aspx pages.

    I'm loading these Form Details in a ext:Window with Loader tag.
    <ext:Window ID="wndDetails" runat="server" Icon="ApplicationFormEdit" Resizable="false" Hidden="true" Modal="true" Constrain="true" Width="400" Height="300">
                <Loader runat="server" AutoLoad="true" Url="~/default.aspx" Mode="Frame" TriggerEvent="show" ReloadOnEvent="true">
                    <LoadMask Msg="Carregando..." ShowMask="true" />
                        <Params>
                            <ext:Parameter Name="ID" Value="" Mode="Value" />
                        </Params>
                    </Loader>
            </ext:Window>
    My question is:
    How do I get the parameter set in Window Loader there in Form Details aspx?

    Thanks for any help!
    Last edited by Daniil; Feb 17, 2012 at 2:27 PM. Reason: [CLOSED]
  2. #2
    Hi,

    In code behind, for example, Page_Load, from Request.
    Request["ID"]
  3. #3
    Hi Daniil...

    Thanks for your reply...

    I had already tried that...

    However, I tried again, but the Request ("ID") or Request.QueryString ("ID") always returns empty.

    I declared a window in my mainpage as follow:
    <ext:Window ID="wndDetails" runat="server" Icon="ApplicationFormEdit" Resizable="false" Hidden="true" Modal="true" Constrain="true" Width="400" Height="300">
                <Loader runat="server" AutoLoad="true" Url="~/default.aspx" Mode="Frame" TriggerEvent="show" ReloadOnEvent="true">
                    <LoadMask Msg="Carregando..." ShowMask="true" />
                        <Params>
                            <ext:Parameter Name="ID" Value="" Mode="Value" />
                        </Params>
                    </Loader>
            </ext:Window>
    And I get the selected record in my GridPanel and set the parameter before window show, as follow:
       Protected Sub EditRecord(sender As Object, evt As DirectEventArgs)
            Dim recordID As String = evt.ExtraParams("recordID")
            
            If recordID <> "null" Then 
                wndDetails.Loader.Params("ID") = recordID
                wndDetails.Show()
            End If
            
        End Sub
    recordID has value, I checked.

    I'm doing something wrong?
  4. #4
    This
    wndDetails.Loader.Params("ID") = recordID
    doesn't affect during DirectEvent.

    To force it to be affected you should call the Window's LoadContent method.

    In addition, there is a bug in Ext.NET DP1.

    After update to Ext.NET v2 beta, the following example will work correct.

    The fix is related to many things, therefore I can't provide it right now. Please wait the release.

    Example Parent Page
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Show(object sender, DirectEventArgs e)
        {
            this.Window1.Show();
    
            this.Window1.Loader.Params["test"] = "Hello World!";
            this.Window1.LoadContent();
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" SourceFormatting="false" />
            <ext:Window ID="Window1" runat="server" Hidden="true">
                <Loader 
                    runat="server" 
                    Mode="Frame" 
                    Url="Test.aspx" 
                    AutoLoad="false">
                    <LoadMask ShowMask="true" />
                </Loader>
            </ext:Window>
            <ext:Button runat="server" Text="Show" OnDirectClick="Show" />
        </form>
    </body>
    </html>
    Example Child Page
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Label1.Text = this.Request.QueryString["test"];
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Label ID="Label1" runat="server" />
        </form>
    </body>
    </html>
  5. #5
    Ok... thanks a lot for your help...

    I'll be waiting DP2 version. I have a few bugs in my system that depend on this version.
  6. #6
    Please feel free to report if you will face any issues with a new release.

Similar Threads

  1. [CLOSED] ext:Window Loader Autosize
    By supera in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Sep 05, 2016, 8:07 PM
  2. [CLOSED] Loader with Html renderer and Window rendering
    By paulc in forum 2.x Legacy Premium Help
    Replies: 33
    Last Post: Jun 25, 2013, 8:43 AM
  3. Replies: 2
    Last Post: Apr 27, 2012, 12:14 PM
  4. Replies: 3
    Last Post: Mar 19, 2012, 1:35 PM
  5. Replies: 5
    Last Post: Dec 07, 2010, 6:06 PM

Posting Permissions