[CLOSED] UserControlLoader inside Bin of Panel with the UserControl a Window inside a Bin of another Control, cannot getValue()

  1. #1

    [CLOSED] UserControlLoader inside Bin of Panel with the UserControl a Window inside a Bin of another Control, cannot getValue()

    Control Tree:
    <Panel>
      <Bin>
        <UserControlLoader Path=UserControl1>
    
           <UserControl1>
             <Menu>
                <Bin>
                   <Window>
                     <TextField ID="TextF">

    The Reference in javascript to #{TextF}.getValue() causes an exception undefined. Rendered output constructs App.ctl00_cp_EventUC_ctl70_TextF.getValue() properly.

    Exception is that that App.ctl00_cp_EventUC_ctl70_TextF is undefined.

    In client-side debugger, I expand App. App.ctl00_cp_EventUC_ctl70_TextF does not appear in list of controls. None of the controls in fact, none of the controls in App.ctl00_cp_EventUC_ctl70... appear.

    When I move the Window to the same level as the Menu.

    <Panel>
      <Bin>
        <UserControlLoader Path=UserControl1>
    
           <UserControl1>
             <Menu>
    
             <Window>
                <TextField ID="TextF">
    Expanding App does show some App.ctl00_cp_EventUC_ctl70... controls, but somehow still, not all.
    Last edited by Daniil; Oct 04, 2013 at 5:56 AM. Reason: [CLOSED]
  2. #2
    Hi @michaeld,

    I cannot reproduce with this test case. Could you provide your test case, please?

    Page
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            
            <ext:Panel runat="server">
                <Bin>
                    <ext:UserControlLoader runat="server" Path="TestUC.ascx" />
                </Bin>
            </ext:Panel>
        </form>
    </body>
    </html>
    User Control
    <%@ Control Language="C#" %>
    
    <ext:Menu runat="server">
        <HtmlBin>
            <ext:XScript runat="server">
                <script>
                    Ext.onReady(function() {
                        alert(#{TextField1}.getValue());
                    });
                </script>
            </ext:XScript>
            
        </HtmlBin>
        <Bin>
            <ext:Window runat="server">
                <Items>
                    <ext:TextField ID="TextField1" runat="server" Text="Hello!" />
                </Items>
            </ext:Window>
        </Bin>
    </ext:Menu>
  3. #3
    You're right, and I'm sorry for goose-chasing you without a sample. My analysis of the issue wasn't comprehensive enough. The control that's failing is 4 user controls deep so reproduction is proving a challenge. I'm having a hard time reproducing the situation in a smaller sample, but I'm still working on it. Spent half the day so far. I may have to track into ext.net next.
  4. #4
    Okay, so I think I was totally off the mark on what the issue is or how App populates controls. The issue is that the App section is not populated when I'm referring to the getValue() in a store.

    I may be doing this totally wrong, so please advise. The code below's URL is populated elsewhere but the exception gets trapped as I've discovered it in this sample.
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <script runat="server">
    	protected void Page_Load( object sender, EventArgs e ) {
    	}
    </script>
    
    
    <!DOCTYPE html>
    <html>
    <head id="Head1" runat="server">
    	<title>Test32</title>
    </head>
    <body>
    	<form id="Form1" runat="server">
    		<ext:ResourceManager ID="ResourceManager1" runat="server" ViewStateMode="Enabled" ScriptMode="Debug" SourceFormatting="true" />
    		<ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
    			<LayoutConfig>
    				<ext:VBoxLayoutConfig Align="Stretch" />
    			</LayoutConfig>
    			<Items>
    				<ext:Panel runat="server" Flex="1" Title="Test" Layout="VBoxLayout">
    					<LayoutConfig><ext:VBoxLayoutConfig Align="Stretch" /></LayoutConfig>
    					<Items>
    						<ext:Label Html="-Show" Height="20" />
    						<ext:TriggerField ID="Address" runat="server" Flex="1" Text="333">
    							<Triggers>
    								<ext:FieldTrigger Icon="Search" Qtip="Search" />
    							</Triggers>
    							<Listeners>
    								<TriggerClick Handler="
    											#{astore}.load();" />
    							</Listeners>
    						</ext:TriggerField>
    						<ext:GridPanel ID="fbagv" runat="server" Title="Pick a location" StripeRows="true" Height="238" Frame="true" Width="488">
    							<Store>
    
    
    								<ext:Store ID="astore" runat="server" ShowWarningOnFailure="true" AutoLoad="false">
    									<Proxy>
    										<ext:AjaxProxy Json="true">
    											<ActionMethods Read="GET" />
    											<ExtraParams>
    												<ext:Parameter Name="q" Value="#{Address}.getValue()" Mode="Raw" /><%-- This Fails --%>
    											</ExtraParams>
    											<ActionMethods Read="GET" />
    											<Reader>
    												<ext:JsonReader Root="data" />
    											</Reader>
    										</ext:AjaxProxy>
    									</Proxy>
    									<Model>
    										<ext:Model ID="Model1" runat="server">
    											<Fields>
    												<ext:ModelField Name="id" Type="String" />
    												<ext:ModelField Name="name" Type="String" />
    												<ext:ModelField Name="location">
    												</ext:ModelField>
    											</Fields>
    										</ext:Model>
    									</Model>
    								</ext:Store>
    							</Store>
    							<ColumnModel Width="500">
    								<Columns>
    									<ext:Column ID="Name" runat="server" Text="Name" DataIndex="name" Sortable="true" Groupable="true" Width="98" />
    									<ext:Column ID="Column1" runat="server" Text="Address" DataIndex="location" Sortable="true" Groupable="true" Flex="1" />
    								</Columns>
    							</ColumnModel>
    							<SelectionModel>
    								<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single" />
    							</SelectionModel>
    							<View>
    								<ext:GridView />
    							</View>
    						</ext:GridPanel>
    					</Items>
    					<Listeners>
    					</Listeners>
    				</ext:Panel>
    			</Items>
    		<Items>
    
    
    		</Items>
    		</ext:Viewport>
    
    
    	</form>
    </body>
    </html>
  5. #5
    A Proxy's ExtraParams is populated in such a way that "App.Address.getValue()" is executed right away even before populating the App namespace.

    Another thing with that. A Proxy's ExtraParams won't be re-calculated on next load requests.

    You can use a Store's Parameters for your requirement.
    <Parameters>
        <ext:StoreParameter Name="q" Value="#{Address}.getValue()" Mode="Raw" Action="Read" />
    </Parameters>

Similar Threads

  1. Replies: 4
    Last Post: Dec 19, 2012, 9:58 AM
  2. Replies: 0
    Last Post: Nov 28, 2012, 8:08 AM
  3. Replies: 8
    Last Post: Feb 15, 2012, 9:04 AM
  4. Help with UserControl inside window
    By dbassett74 in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2009, 4:25 PM
  5. [CLOSED] Get ext control inside UserControl
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 22, 2008, 1:24 PM

Posting Permissions