Apr 11, 2009, 3:39 PM
Add Items to combobox dynamically problem
Hi,
I have a next problem..
I want to fill the combobox with items.. but I can do this only in page load... I need fill new items when AjaxEvent happen..
I prepare little example of my problem.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test_combobox.aspx.vb" Inherits="test_combobox" %>
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
* <title>Untitled Page</title>
</head>
<body>
* <form id="form1" runat="server">
*
* <ext:ScriptManager ID="ScriptManager1" runat="server" />
*
* <ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
* <Body>
* <ext:ComboBox ID="ComboBox1" runat="server">
* </ext:ComboBox>
* <ext:Button ID="Button1" runat="server" Text="Submit">
* <AjaxEvents>
* <Click OnEvent="mmks_fillcombobox">
* </Click>
* </AjaxEvents>
* </ext:Button>
* *
* </Body>
* </ext:Panel>
* </form>
</body>
</html>
and simple method to refill combo is*
Partial Class test_combobox
* Inherits System.Web.UI.Page
* Protected Sub mmks_fillcombobox()
* Dim lni As Integer
* For lni = 1 To 10
* Me.ComboBox1.Items.Add(New Coolite.Ext.Web.ListItem("Page " + lni.ToString, lni.ToString))
* Next
* End Sub
End Class
When I try to expand combobox - I'v got a JavaScript error..Microsoft JScript runtime error "This.store" is null or not an object*
I look examples.. and everywhere using Store object.. can I avoid to use store object and fill items with Items.add() in the code?
Thank you!