WebCombo Failing When Used Inside Webpart

1 reply. Last post: April 19, 2011 3:10 AM by Martin Lie
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Rob PadgettMember
I used a Webcombo instance of a filter page directly, using a SqlDataSource to bind to for the data and it works fine.

When I copy this same code into an ASCX file that is going to be used as a webpart component, it fails.

The webpart page is basically a container page with a table.  In this table it creates instances of ASP components.  One of those components is a copy of the code from our filter search page.  It is in this component where I have several instances of WebCombo.  When I type or drop the list down it loads for a long time and comes up empty.  If I check the javascript console I see that I'm repeatedly getting this error from WebCombo.js

'event' is null or not an object       WebCombo.js, line 7 character 31460

Below is a snippet from the outer container page where the component is added.  There is some other stuff on this page to and can add it if its neccessary to figure out why this isn't working.
<%@ Register Src="webparts/contractsearch.ascx" TagName="contractsearch" TagPrefix="exec" %>
<table>
<tr>
	<td id="tdLeft" runat="server" style="vertical-align:top; text-align:left; width:33%">
	    <tm:tmzwebpartzone id="wpzLeft" runat="server" headertext="Left" PartChromeType="TitleAndBorder" width="320px" PartStyle-CssClass="PartStyle" PartTitleStyle-CssClass="PartTitleStyle" PartChromeStyle-BorderColor="transparent" AllowShrink="false">
			<VerbStyle CssClass="gridheading" />
			<HeaderStyle BorderColor="black" borderstyle="solid" CssClass="leftnavselected" />
			<MenuPopupStyle  BackColor="white" BorderColor="black" BorderWidth="1px" GridLines="Horizontal" Font-Names="verdana" Font-Size="8pt" />
			<zonetemplate>	
			        <exec:contractsearch ID="contractSearch3" runat="server" Title="Contract Search" AuthorizationFilter="tmproductline=999"/>
			</zonetemplate>
	    </tm:tmwebpartzone>
    </td>
</tr>
</table>

 And here is the code for the component.

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="contractsearch.ascx.vb" Inherits="ExecComm.contractsearch" %>
<%@ Register Assembly="TMControls" Namespace="TractManager.TMControls" TagPrefix="cc1" %>
<%@ Register Assembly="ISNet.WebUI.WebCombo" Namespace="ISNet.WebUI.WebCombo" TagPrefix="ISWebCombo" %>
<div id="dClass" runat="server" class="tmpart">
<asp:ScriptManager ID="ContractSearchScriptManager" runat="server" EnablePartialRendering="true" />
<asp:UpdatePanel ID="ContractSearchPanel" runat="server">
	<ContentTemplate>
		<asp:Label id="lblError" runat="server" EnableViewState="false" CssClass="error-message" />
		<asp:Label id="lblLoadTime" runat="server" EnableViewState="false" CssClass="error-message" />
	
		<table id="tabSearch" cellspacing="1" cellpadding="2" border="0" width="99%" style="z-index:999;">
		 <tr>
			<td colspan="2" rowspan="1" style="vertical-align:top; text-align:left; white-space:nowrap; width:100%;">
				<asp:Label id="lblSubHeadingTop" runat="server" width="99%" CssClass="subheading"></asp:Label>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblEntity" runat="server" Font-Bold="true" CssClass="controls"/>
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
  				<cc1:TMDropDown ID="cblEntity" runat="server" DataTextField="Name" DataValueField="ID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboEntity" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblSite" runat="server" Font-Bold="true" CssClass="controls"/>
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblSite" runat="server" DataTextField="Name" DataValueField="ID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboSite" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblDepartment" runat="server" Font-Bold="true" CssClass="controls"/>
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblDepartment" runat="server" DataTextField="Name" DataValueField="ID" Width="185px" cssclass="controls" />
   				<ISWebCombo:WebCombo id="cboDepartment" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:20%; ">
				<asp:Label id="lblType" runat="server" Font-Bold="true" CssClass="controls"/>
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblContractType" runat="server" DataTextField="ContractTypeName" DataValueField="ContractTypeID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboContractType" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblStatus" runat="server" Font-Bold="true" Text="Status:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<asp:checkboxlist ID="cblStatus" runat="server" DataTextField="Name" DataValueField="ID" Width="185px" CssClass="controlist" />
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblPrimaryRP" runat="server" Font-Bold="true" Text="Primary RP:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblPrimaryRP" runat="server" DataTextField="LastNameFirstName" DataValueField="ID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboPrimaryRP" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblSecondaryRP" runat="server" Font-Bold="true" Text="Secondary RP:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblSecondaryRP" runat="server" DataTextField="LastNameFirstName" DataValueField="ID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboSecondaryRP" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblThirdRP" runat="server" Font-Bold="true" Text="Third RP:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblThirdRP" runat="server" DataTextField="LastNameFirstName" DataValueField="ID" Width="185px" cssclass="controls" />
				<ISWebCombo:WebCombo id="cboThirdRP" runat="server" Visible="false" DropDownRows="100" Width="185px" ToolTip="Start typing to search, or control-space to see list." UseDefaultStyle="true">
					<LayoutSettings AlwaysShowHelpButton="true" AlwaysShowSearchButton="true" />
					<MultipleSelectionSettings Enabled="true" AllowNotInListText="false" HideResultBoxOnEmptyResult="false" AllowBrowseAll="true" />
				</ISWebCombo:WebCombo>
			</td>
		 </tr>
		 <tr>
			<td colspan="2" rowspan="1" style="vertical-align:top; text-align:left; white-space:nowrap; width:100%;">
				 
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label ID="lblSort" runat="server" Font-Bold="true" Text="Sort By:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<asp:dropdownlist ID="ddlSort" runat="server" tabIndex="5" Width="185px" cssclass="controls"/>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label ID="lblKeyword" runat="server" Font-Bold="true" Text="Keyword:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<asp:TextBox id="txtKeyword" tabIndex="6" runat="server" Width="180px" CssClass="controls"></asp:TextBox>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;"> </td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<table border="0" cellpadding="0" cellspacing="0" width="100%">
				 <tr>
					<td style="width:100%;">
						<asp:button id="cmdSearch" tabIndex="7" runat="server" Text="Search" Width="60px" CssClass="button" />
        				<asp:button id="cmdSearchFuzzy" tabIndex="8" runat="server" Text="Fuzzy Search" Width="100px" CssClass="button" Visible="False" />
        				<asp:Button id="cmdClose" runat="server" Text="Close" width="60px" CssClass="button" Visible="false" OnClientClick="form_dialog.hide();return false;" />
        			</td>
				 </tr>
				</table></td>
		 </tr>
		 <tr>
			<td colspan="2" rowspan="1" style="vertical-align:top; text-align:left; white-space:nowrap; width:100%;">
				 
			</td>
		 </tr>
		 <tr>
			<td colspan="2" rowspan="1" style="vertical-align:top; text-align:left; white-space:nowrap; width:100%;">
				<asp:Label id="lblSubHeadingBottom" runat="server" width="99%" CssClass="subheading"></asp:Label>
			</td>
		 </tr>
		 <tr visible="False">
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:20%;" visible="False">
				<asp:Label ID="lblKeywordType" runat="server" Font-Bold="True" Text="Look For Keyword Type:" CssClass="controls" Visible="False"/>
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;" visible="False">
				<asp:DropDownList id="lstKeywordType" tabIndex="9" runat="server" Width="185px" CssClass="controls" Visible="False">
					<asp:ListItem Value="1">Matches Keyword Exactly</asp:ListItem>
					<asp:ListItem Value="2">Starts With Keyword</asp:ListItem>
					<asp:ListItem Value="3">Includes Keyword</asp:ListItem>
				</asp:DropDownList>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label ID="lblTop" runat="server" Font-Bold="true" Text="Return A Maximum Of:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<asp:DropDownList id="lstTop" tabIndex="10" runat="server" Width="185px" CssClass="controls">
					<asp:ListItem Value="10">10</asp:ListItem>
					<asp:ListItem Value="25">25</asp:ListItem>
					<asp:ListItem Value="50">50</asp:ListItem>
					<asp:ListItem Value="100">100</asp:ListItem>
					<asp:ListItem Value="150">150</asp:ListItem>
					<asp:ListItem Value="200">200</asp:ListItem>
					<asp:ListItem Value="250">250</asp:ListItem>
					<asp:ListItem Value="0" Selected="True">Unlimited</asp:ListItem>
				</asp:DropDownList>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label ID="lblFullText" runat="server" Font-Bold="true" Text="Full Text Option:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<asp:DropDownList id="lstFullText" tabIndex="11" runat="server" Width="185px" CssClass="controls"/>
			</td>
		 </tr>
		 <tr>
			<td style="vertical-align:top; text-align:left; width:20%;">
				<asp:Label id="lblOrganizations" runat="server" Font-Bold="true" Width="100%" Text="Database(s) Option:" CssClass="controls" />
			</td>
			<td style="vertical-align:top; text-align:left; white-space:nowrap; width:78%;">
				<cc1:TMDropDown ID="cblOrganizations" runat="server" Width="185px" cssclass="controls" />
			</td>
		 </tr>
		 <tr>
			<td colspan="2" rowspan="1" style="vertical-align:top; text-align:left; white-space:nowrap; width:100%;">
				<asp:TextBox id="txtDebug" runat="server" Height="200px" Width="185px" TextMode="MultiLine" Visible="False" />
			</td>
		 </tr>
		</table>
		<asp:SqlDataSource ID="dsEntities" runat="server" SelectCommand="sp_0" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsDepartments" runat="server" SelectCommand="sp_organization_user_department_list" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsSites" runat="server" SelectCommand="sp_1" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsContractTypes" runat="server" SelectCommand="sp_2" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsPrimaryRPUsers" runat="server" SelectCommand="sp_3" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsSecondaryRPUsers" runat="server" SelectCommand="sp_4" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
		<asp:SqlDataSource ID="dsThirdRPUsers" runat="server" SelectCommand="sp_5" SelectCommandType="StoredProcedure">
			<SelectParameters>
				<asp:Parameter Name="organization" Type="Int32" DefaultValue="0" />
				<asp:Parameter Name="user" Type="Int32" DefaultValue="0" />
			</SelectParameters>
		</asp:SqlDataSource>
	</ContentTemplate>
</asp:UpdatePanel>
</div>

 

All times are GMT -5. The time now is 1:45 AM.
Previous Next