[FIXED] [V0.7.0] Parameter JavaScript Error

  1. #1

    [FIXED] [V0.7.0] Parameter JavaScript Error

    Hello,

    If you run the following example, you'll notice that the base parameter is getting confused which drpPermissions combobox to retrieve the ClientID from, and I believe it just grabs the first one even though the first one is not visible [Smile]

    Example.aspx:

    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected override void OnInit(EventArgs e)
        {
            Control control1 = Page.LoadControl("Example-Control.ascx");
    
            UserControl1.Controls.Add(control1);
    
            Control control2 = Page.LoadControl("Example-Control.ascx");
    
            UserControl2.Controls.Add(control2);
            
            base.OnInit(e);
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
            <ext:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" />
            <ExtJS:Panel runat="server" Border="False" Visible="False">
                <Content>
                    <asp:PlaceHolder ID="UserControl1" runat="server" />
                </Content>
            </ExtJS:Panel>
            <ExtJS:Panel runat="server" Border="False">
                <Content>
                    <asp:PlaceHolder ID="UserControl2" runat="server" />
                </Content>
            </ExtJS:Panel>
        </form>
    </body>
    </html>
    Example-Control.ascx:

    <%@ Control Language="C#" ClassName="Example_Control" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Permissions.DataSource = new object[] {
                new object[] { 1, "Permission", "Permission 1" },
                new object[] { 2, "Permission", "Permission 2" },
                new object[] { 3, "Permission", "Permission 3" },
                new object[] { 4, "Permission", "Permission 4" },
                new object[] { 5, "Permission", "Permission 5" },
                new object[] { 6, "Permission", "Permission 6" }
            };
            Permissions.DataBind();
        }
    </script>
    <ext:Store ID="Permissions"
        runat="server"
        AutoLoad="True"
        GroupField="GroupingName">
        <Reader>
            <ext:ArrayReader ReaderID="PermissionId">
                <Fields>
                    <ext:RecordField Name="PermissionId" />
                    <ext:RecordField Name="GroupingName" />
                    <ext:RecordField Name="DisplayName" />
                </Fields>
            </ext:ArrayReader>
        </Reader>
                    <BaseParams>
                        <ext:Parameter Name="PermissionId" Value="#{drpPermissions}.getValue()" Mode="Raw" />
                    </BaseParams>
        <SortInfo Field="DisplayName" />
    </ext:Store>
    <ext:ComboBox ID="drpPermissions" runat="server" StoreID="Permissions" DisplayField="DisplayName" Mode="Local" ValueField="PermissionId" />
    I know it's a funny scenario, but I do use the name drpPermissions in numerous controls, and sometimes they can be loaded on the same page, although not visible.

    Cheers,
    Timothy

  2. #2

    RE: [FIXED] [V0.7.0] Parameter JavaScript Error



    Confirmed. This is a bug. We are working on a fix.
    Geoffrey McGill
    Founder
  3. #3

    RE: [FIXED] [V0.7.0] Parameter JavaScript Error

    Great thanks Geoffrey, just reply here and I'll confirm SVN.

    Cheers,
    Timothy
  4. #4

    RE: [FIXED] [V0.7.0] Parameter JavaScript Error

    Hi Timothy,

    the fix in SVN

  5. #5

    RE: [FIXED] [V0.7.0] Parameter JavaScript Error

    Appears to be resolved, I'm getting another JavaScript error for a RequiredFieldValidator that is not visible, but I'll start a new post on that one once I track it down and replicate it.

    Thanks vlad!

    Cheers,
    Timothy

Similar Threads

  1. Replies: 0
    Last Post: May 14, 2012, 3:41 PM
  2. [CLOSED] JAVASCRIPT - get parameter URL
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 29, 2011, 2:53 PM
  3. Replies: 4
    Last Post: Aug 19, 2009, 2:01 PM
  4. Replies: 6
    Last Post: May 26, 2009, 3:03 PM
  5. [FIXED] [V0.6] JavaScript error
    By Timothy in forum Bugs
    Replies: 1
    Last Post: Aug 28, 2008, 11:43 AM

Posting Permissions