iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have a custom date control made of 3 components: WebCombo and two WebInput calendars. The WebCombo gives the user a preset number of options that automatically set the calendars, i.e., Yesterday, Last Week, This Month, etc.
When the user directly sets the dates via the calendars, then we want to automatically set the combo's range type selection to our "Custom" selection. I'm doing that via a workaround using the code below:
oIsCbo.SelectedIndex = i; oIsCbo.SetValue(oDRT.dateRangeTypeId); oIsCbo.SetTextBoxValue(oDRT.dateRangeTypeName);
I'm using this workaround because both SetSelectedIndex and SetSelectedRowByValue crash when called. Both calls cause the javascript runtime error of "'this.Column.BaseFieldName' is null or not an object." I'm using an unbound combo and all the UI elements do not post back so everything is done client-side. We don't want a simple control like this to constantly post back on every little user change.
Here's how our PrismComboBox (derives from ISNet.WebUI.WebCombo.WebCombo) is set up:
this.AllowWildCardSearch = true; this.EnableViewState = true; this.Items = new PrismComboBoxItems(); this.Items.ComboBox = this; this.SelectedItem = new PrismComboBoxSelectedItem(); this.SelectedItem.ComboBox = this; this.LayoutSettings.AllowAddItem = false; this.LayoutSettings.AllowFloatingText = false; this.LayoutSettings.AllowNavigationOnMouseWheel = true; this.LayoutSettings.AllowTextWrapping = false; this.LayoutSettings.AlwaysShowAllRowsOnDropdown = true; this.LayoutSettings.AlwaysShowColumnHeaders = false; this.LayoutSettings.AlwaysShowHelpButton = false; this.LayoutSettings.AlwaysShowResultBox = false; this.LayoutSettings.AlwaysShowSearchButton = true; this.LayoutSettings.AutoColumnOrdering = false; this.LayoutSettings.ComboMode = ISNet.WebUI.WebCombo.Mode.SingleColumn; this.LayoutSettings.EnableAnimation = true; this.LayoutSettings.EnableSlidingAnimation = true; this.LayoutSettings.EntryMode = ISNet.WebUI.WebCombo.EntryMode.AutoComplete; this.LayoutSettings.NoResultFoundAction = ISNet.WebUI.WebCombo.NoResultFoundAction.RevertSelection; this.LayoutSettings.SearchIconMode = ISNet.WebUI.WebCombo.SearchMode.Text; this.LayoutSettings.TextBoxMode = ISNet.WebUI.WebCombo.TextboxMode.Editable; this.UseDefaultStyle = false; this.SelectionRequired = false;
Here's how the combo box is further configured and populated in our PrismDateRange control:
m_ComboboxRangeType.ID = "ComboBoxRangeType"; m_ComboboxRangeType.AutoPostBack = AutoPostBack; m_ComboboxRangeType.SelectedIndexChanged += new EventHandler(m_ComboboxRangeType_SelectedIndexChanged); m_ComboboxRangeType.PreRender += new EventHandler(m_ComboboxRangeType_PreRender); m_ComboboxRangeType.Enabled = this.Enabled; m_ComboboxRangeType.DropDownRows = 50; m_ComboboxRangeType.Width = Unit.Percentage(100); m_ComboboxRangeType.LayoutSettings.StatusBoxVisible = false; m_ComboboxRangeType.LayoutSettings.ResultBoxShadow = false; m_ComboboxRangeType.LayoutSettings.ResultBoxWindowType = ISNet.WebUI.DisplayType.Normal; m_ComboboxRangeType.Enabled = true; m_ComboboxRangeType.insertBlankRow = false; m_ComboboxRangeType.DataValueField = "dateRangeTypeID"; m_ComboboxRangeType.DataTextField = "dateRangeTypeName"; ISNet.WebUI.WebCombo.WebComboColumn colText = new ISNet.WebUI.WebCombo.WebComboColumn(); colText.BaseFieldName = m_ComboboxRangeType.DataTextField; colText.Bound = false; colText.ColumnType = ISNet.WebUI.WebCombo.ColumnType.Text; colText.DataType = "System.String"; colText.Hidden = false; colText.Name = m_ComboboxRangeType.DataTextField; ISNet.WebUI.WebCombo.WebComboColumn colValue = new ISNet.WebUI.WebCombo.WebComboColumn(); colValue.BaseFieldName = m_ComboboxRangeType.DataValueField; colValue.Bound = false; colValue.ColumnType = ISNet.WebUI.WebCombo.ColumnType.Text; colValue.DataType = "System.String"; colValue.Hidden = true; colValue.RenderOnHidden = true; colValue.Name = m_ComboboxRangeType.DataValueField; m_ComboboxRangeType.Columns.Add(colText); m_ComboboxRangeType.Columns.Add(colValue); m_ComboboxRangeType.PopulateUnboundData(GetTypeTable(),false); if (CPRISMStrLib.IsVs(ReportCategoryId)) { m_ComboboxRangeType.Value = CPRISMStrLib.GetStr(GetDefTable().Rows[0]["defaultDateRangeTypeID"]); m_ComboboxRangeType.SelectedValue = m_ComboboxRangeType.Value; }
I've attached a couple falsh videos of the issue while running in debug mode. The first one shows the crash when SetSelectedIndex is hit and the value of this.Column. The second one breaks into my javascript code and also shows the result of SetSelectedRowByDefault in the watch window as well as continuing on and the crash of SetSelectedIndex.
As you can see above, the BaseFieldName is set up so I'm not sure why all that is empty on the client side, i.e., this.Column and so on. Let me know if you need anything else.
I'm in a bind to get this working please so I can really use a fast resolution. Thanks a lot.
I created a test page based on your information regarding the issue. The issue happens when user directly sets the dates via the calendar and WebCombo range type selection should be automatically set specific value/text, in this case is “Custom”. Instead of set WebCombo to specific value/text, it throws “’this.Column.BaseFieldName’ is null or not an object” error message.
I tried to simplify the issue by sets WebCombo value/text on button click client-side event. In my test page, I tried four method to set unbound WebCombo value/text, by using SetText() method; SetSelectedIndex() method; SetSelectedRowByValue() method; and by selecting the row object.
No error happens when using all of the method and I was unable to reproduce your issue using my test page. I enclose the test page as attachment so that you can test it on your end and let me know if there is anything that I miss during my attempt to replicates your issue. you may also modify the test page and send it back to us for further investigation.
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