[CLOSED] Error when create a dynamic SelectBox

  1. #1

    [CLOSED] Error when create a dynamic SelectBox

    Hi,
    Today, after updating ext.net via SVN, we are getting this error when creating a dynamic SelectBox

    Uncaught TypeError: Cannot read property 'SelectBox' of undefined

    these samples demonstrates the error

    <ext:ResourceManager runat="server" ScriptMode="Debug"></ext:ResourceManager>
        <ext:Panel ID="TestPanel" runat="server" Border="false"></ext:Panel>
        <ext:Button ID="TestButton" runat="server" Text="Test Button">
            <DirectEvents>
                <Click OnEvent="TestButton_Click"></Click>
            </DirectEvents>
        </ext:Button>
    protected void Page_Load(object sender, EventArgs e)
    {
    
    }
    
    protected void TestButton_Click(object sender, Ext.Net.DirectEventArgs e)
    {
        var selectBox = new SelectBox();
        selectBox.ID = "TestSelectBox";
        selectBox.Items.Add(new Ext.Net.ListItem("Item 1", "1"));
        selectBox.Items.Add(new Ext.Net.ListItem("Item 2", "2"));
        selectBox.Items.Add(new Ext.Net.ListItem("Item 3", "3"));
        selectBox.Listeners.Select.Handler = "alert(this.getValue());";
        selectBox.AddTo(TestPanel);
    }
    thanks.
    Last edited by Daniil; Mar 12, 2012 at 12:34 PM. Reason: [CLOSED]
  2. #2
    Hi,

    SelectBox resources appear to be not automatically loaded. We are investigating the issue. Thanks for the report.

    To fix it right now, please call:
    ResourceManager.RegisterControlResources<SelectBox>();
    before the AddTo calling.
    Last edited by Daniil; Mar 10, 2012 at 2:49 PM.
  3. #3
    Hi,

    Fixed in SVN.
    If someone cannot update then replace line #159 in 'Ext.Net\Utility\ScriptBuilders\DefaultScriptBuild er.cs'
    this.ResourceManager = newMgr;
    by this code
    this.ResourceManager = Ext.Net.ResourceManager.GetInstance() ?? newMgr;
  4. #4
    thanks!! solved.

Similar Threads

  1. Replies: 4
    Last Post: Oct 24, 2011, 3:34 AM
  2. Error happened when I create dynamic GridPanel
    By hazardvn in forum 1.x Help
    Replies: 3
    Last Post: Aug 01, 2011, 6:59 AM
  3. Replies: 4
    Last Post: May 31, 2011, 3:53 PM
  4. [CLOSED] Create a dynamic event for dynamic components.
    By stoque in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: May 10, 2011, 9:16 PM
  5. Dynamic Create GridPanel and Load Data Error
    By fancycloud in forum Examples and Extras
    Replies: 2
    Last Post: Jan 05, 2010, 2:52 AM

Tags for this Thread

Posting Permissions