How do I wait for the DropDown to be loaded in the WebCombo Client Side OnBlur Event?

12 replies. Last post: October 27, 2009 12:27 AM by Glenn Layaar
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Hi,
 
On 10/6/2009, I downloaded the trial version, "intersoft webui studio 2009 r1 sp1.exe".
 
I have a PARTS_LIST Table with over 10,000 records.
 
I have implemented the WebCombo with the code below.
 
When the User types in a Part Number in the PARTS_LIST Table, I need to populate the DESCRIPTION in an asp:TextBox with Client Side Code.
 
I want to allow the user to pick from the PARTS_LIST Table or to enter a Part Number not in the Table.
 
If the User types in a Part Number into the TextBox portion of the WebCombo, which is in the Database, and Tabs off of it before the dropdown portion has loaded, the WebCombo.Value is incorrect.
 
This is probably occurring because the DropDown is being loaded asynchronously which allows the OnLostFocus Event to occur before it is loaded.  
 
How do I wait in the Client Side OnLostFocus Event for the DropDown Loading to complete?
 
Or, is there another Client Side Event or configuration I should use?
 
Thanks,
 
Doug
 
 

<%@ Page Title="" Language="C#" MasterPageFile="~/Branding/MasterPageNewCoSimple.master" AutoEventWireup="true" CodeFile="ComboBoxInterSoft.aspx.cs" Inherits="Refurb_ComboBoxInterSoft" %>

 

<%@ Register assembly="ISNet.WebUI.WebCombo" namespace="ISNet.WebUI.WebCombo" tagprefix="ISWebCombo" %>

 

<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">

 

<script language="javascript" type="text/javascript">

 

      function PartNumber_WebCombo_OnLostFocus(controlId) {

 

            var PartNumber_WebCombo = ISGetObject(controlId);

 

            var PartNumber_TextBox = document.getElementById("<%= PartNumber_TextBox.ClientID %>");

            var PartDescription_TextBox = document.getElementById("<%= PartDescription_TextBox.ClientID %>");

 

 

            PartNumber_TextBox.value = PartNumber_WebCombo.GetTextBoxValue();

 

// TODO: Wait for DropDown to load

            PartDescription_TextBox.value = PartNumber_WebCombo.Value;

 

            return true;

 

      }

 

 

</script>

 

      <table>

            <tr>

                  <td>

                        <ISWebCombo:WebCombo

                              ID="PartNumber_WebCombo"

                              runat="server"

                              DataSourceID="PartsList_SqlDataSource"

                              DataTextField="PART_NUM"

                              DataValueField="DESCRIPTION"

                              UseDefaultStyle="true"

                              Height="20px"

                              Width="200px"

                        >

                    <Columns>

                        <ISWebCombo:WebComboColumn BaseFieldName="PART_NUM" HeaderText="Part#" Name="ContactName" Width="150px" />

                        <ISWebCombo:WebComboColumn BaseFieldName="DESCRIPTION" HeaderText="Description" Name="Description" Width="455px" />

                    </Columns>

                    <LayoutSettings

                                    ComboMode="MultipleColumns"

                                    EntryMode="AutoComplete"

                                    AllowAddItem="true"

                                   

                              >

                                    <ClientSideEvents

                                          OnLostFocus="PartNumber_WebCombo_OnLostFocus"

                                    />

                    </LayoutSettings>

                        </ISWebCombo:WebCombo>

                  </td>

                  <td>

                        <asp:RequiredFieldValidator

                              ID="PartNumber_WebCombo_RequiredFieldValidator"

                              runat="server"

                              ControlToValidate="PartNumber_WebCombo"

                              Text="*"

                              ErrorMessage="*Please enter a Part."

                              Enabled="true"

                              Display="Static"

                              Visible="true"

                        />

                  </td>

                  <td>

                        <asp:TextBox ID="PartNumber_TextBox" runat="server"></asp:TextBox>

                  </td>

                  <td>

                        <asp:TextBox ID="PartDescription_TextBox" runat="server"></asp:TextBox>

                  </td>

            </tr>

      </table>

     

      <asp:SqlDataSource

            ID="PartsList_SqlDataSource"

            runat="server"

            ConnectionString="<%$ ConnectionStrings:NewCoApp %>"

            SelectCommand="SELECT [PART_NUM], [DESCRIPTION] FROM [PARTS_LIST] ORDER BY [PART_NUM]"

      ></asp:SqlDataSource>

 

 

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="cphFooter" Runat="Server">

</asp:Content>

 

All times are GMT -5. The time now is 4:52 AM.
Previous Next