iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am trying to create webcombo dynamically from code behind because I do not know how many webcombos there will be on the page. I bind data from client side. Here is the code on client. I got error at combo.Render().
<asp:Panel ID="pnlDynamic" runat="server"></asp:Panel>
function BindWebCombo() { var webComboTable = new ISDataTable(); var keyColumn = new ISDataColumn(webComboTable); var textColumn = new ISDataColumn(webComboTable); webComboTable.Name = webComboTable.TableName = "TaxCodesDesc"; keyColumn.Name = keyColumn.ColumnName = "Key"; textColumn.DataType = "System.Int32"; textColumn.Name = textColumn.ColumnName = "Value"; textColumn.DataType = "System.String"; webComboTable.Columns.Add(keyColumn); webComboTable.Columns.Add(textColumn); for (var j = 0; j < 100; j++) { var dataRow = webComboTable.NewRow(); dataRow.Cells.GetNamedItem("Key").Value = j; dataRow.Cells.GetNamedItem("Value").Value = "item" + j.toString(); webComboTable.Rows.Add(dataRow); } for (var i = 1; i <= webComboCount; i++) { combo = ISGetObject("WebCombo" + i.toString()); combo.SetDataSource(webComboTable); combo.DataBind(); combo.Render(); combo.ShowDropDown(); } }
Here is code to create the web combo dynamically in code behind. Same webcombo setting works when setting statically.
protected void CreateWebCombo(int webComboCount) { for (int i = 1; i <= webComboCount; i++) { WebCombo combo = new WebCombo("WebCombo" + i.ToString()); combo.BindingOperationMode = ISNet.WebUI.BindingMode.ClientBinding; combo.DataValueField = "Key"; combo.DataTextField = "Value"; WebComboColumn comboColumn = new WebComboColumn("Description"); comboColumn.BaseFieldName = "Value"; comboColumn.DataType = "System.String"; comboColumn.HeaderText = "Description"; combo.LayoutSettings.EntryMode = EntryMode.AutoComplete; combo.LayoutSettings.StatusBoxVisible = false; combo.FlyPostBackSettings.PostHiddenFields = true; combo.FlyPostBackSettings.PostInputControls = true; combo.ClientBindingSettings.DataSourceType = ISNet.WebUI.ClientDataSourceType.ClientDataSource; pnlDynamic.Controls.Add(combo); } }
Error message:
"Microsoft JScript runtime error: 'innerText' is null or not an object"
Thanks,
Luwen
Handy,
I got error message:
"Microsoft JScript runtime error: Object expected" in eval code [dynamic].
it cannot find BindWebCombo set in
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname