[CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

  1. #1

    [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    I think I may have found a bug in the panel control code generation. I have a Panel inside a user control which has a tool that extracts a value from a text control within the panel in its handler. The code inside the user control looks like:-

    <ext:Panel ID="panelProductArea" runat="server" BodyStyle="padding:5px 5px 0; background-color:transparent;" Frame="false" Border="false" Cls="productArea" Title="Description" Collapsible="true" AutoHeight="true" AutoWidth="true">
        <Tools>
            <ext:Tool Type="Minus" Handler="removeProduct(#{txtParentContractItemId}.getValue());"><QTipCfg Text="Remove" /></ext:Tool>
        </Tools>
        <Content>
            <ext:TextField ID="txtParentContractItemId" runat="server" Hidden="true" />
        </Content>
    </ext:Panel>
    If two controls are added into a panel on a host form, where each user control instance has the ID of 'CP0' and 'CP1' respectively, the generated code for the first control looks like:-

    new Ext.Panel({id:"CP0_panelProductArea",cls:"productArea",renderTo:"CP0_panelProductArea_Container",autoHeight:true,autoWidth:true,bodyStyle:"padding:5px 5px 0; background-color:transparent;",border:false,collapsible:true,title:"Description",tools:[{id:"minus",handler:function(event,toolEl,panel){removeProduct(CP0_txtParentContractItemId.getValue());},qtip:{text:"Remove"}}],contentEl:"CP0_panelProductArea_Content"});
    The second control looks like:-

    new Ext.Panel({id:"CP1_panelProductArea",cls:"productArea",renderTo:"CP1_panelProductArea_Container",autoHeight:true,autoWidth:true,bodyStyle:"padding:5px 5px 0; background-color:transparent;",border:false,collapsible:true,title:"Description",tools:[{id:"minus",handler:function(event,toolEl,panel){removeProduct(CP0_txtParentContractItemId.getValue());},qtip:{text:"Remove"}}],contentEl:"CP1_panelProductArea_Content"});
    Note that the id entered for the text control within the remove tool handler has the same id, i.e. CP0_txtParentContractItemId.getValue(), whilst correct for the first control instance the second control should be CP1_txtParentContractItemId.getValue(). Both text controls are correctly generated with the CP0 and CP1 prefixes.
  2. #2

    RE: [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Hi,

    Fixed. Please update from SVN
  3. #3

    RE: [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Thanks Valdimir - working perfectly now :-)
  4. #4

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Hi,

    I believe I have the same problem in 0.8.2 -- is there a workaround for 0.8.2?

    This is my scenario:

    Example user control:

    <%@ Control Language="C#" AutoEventWireup="true" %>
    
    <ext:Panel ID="WindowLauncher" Title="Window Launcher" runat="server" Width="400" StyleSpec="margin-bottom:2em;">
        <Tools>
            <ext:Tool Type="Search" Handler="#{WindowToLaunch}.show(this);" />
            <ext:Tool Type="Refresh" Handler="#{WindowLauncherButton}.fireEvent('click');" Qtip="This finds the first button instance only" />
        </Tools>
        <Body>
            <p>Click tool to launch window</p>
            <ext:Button ID="WindowLauncherButton" runat="server" Text="Using this launches correct window instance">
                <Listeners>
                    <Click Handler="#{WindowToLaunch}.show(this);" />
                </Listeners>
            </ext:Button>
        </Body>
    </ext:Panel>
    
    <ext:Window ID="WindowToLaunch" runat="server" Show&#111;nload="false">
        <Body>
            <asp:Label ID="WindowLabel" runat="server"><%= ClientID %></asp:Label>
        </Body>
    </ext:Window>
    And here's an example page using it:

    <%@ Page Language="C#" AutoEventWireup="true" %>
    <%@ Register Src="~/WindowTests/WindowContainer.ascx" TagName="WindowContainer" TagPrefix="win" %>
    
    <!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>Launch many windows</title>
    </head>
    <body>
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        <form id="form1" runat="server">
        
            <win:WindowContainer ID="WindowContainer1" runat="server" />
            <win:WindowContainer ID="WindowContainer2" runat="server" />
            <win:WindowContainer ID="WindowContainer3" runat="server" />
        
    
        </form>
    </body>
    </html>
    Unfortunately I am not in a position to upgrade to the 1.0 preview just yet, so need to stick with 0.8.2. Any ideas for a workaround would be much appreciated!
  5. #5

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Hi,

    Try to update 0.8.2 from SVN
  6. #6

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Vladimir,

    Thanks for the speedy response. I got the latest code from SVN 0.8.2 (assuming this is the right place: http://svn.ext.net/premium/tags/0.8.2/ ) but unfortunately I see the same problem, including in the example I pasted in my earlier message.

    To double check, the previous version I was using was this:

    Version 0.8.2.2648
    Now, it is this:

    Version 0.8.2.30727
    Any other thoughts/suggestions?
  7. #7

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Hi,

    Sorry, I thought that we fixed it already for 0.8.2
    I checked and fixed the problem now.
    Now your sample works correctly under 0.8.2
    The fix is committed to the SVN. Please update
  8. #8

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    Hi,

    Please update from the trunk
    http://svn.ext.net/premium/trunk


    Trunk contains 0.8.3 version (which is not released yet). 0.8.3 version is the same as 0.8.2 but with various bug fixes
  9. #9

    RE: [CLOSED] [1.0] Panel tools handler not getting IDs correctly when in a User Control

    I got latest and it seems to work now.

    Many thanks for the swift response, as well!

Similar Threads

  1. [CLOSED] panel icon missing when dynamically load a user control
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 30, 2012, 7:47 AM
  2. Replies: 2
    Last Post: Feb 06, 2012, 9:06 AM
  3. Replies: 6
    Last Post: Dec 07, 2011, 12:55 PM
  4. [CLOSED] Not stretch User Control in Tab panel
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 28, 2011, 8:23 AM
  5. Replies: 0
    Last Post: May 03, 2010, 4:33 AM

Posting Permissions