Hi,
I have a web user control containing 2 RadComboBox's - ddlGroup and ddlGorem.
my ascx is as follows:
on my code behind i include a .js file in the following way:
the ComboBoxScript.js is:
of course the commented lines are the ones I actually want to use, but for now, as nothing is working, I have tried just to get some alerts for debugging the problem.
both combos load just fine, but as I change the selected index in the ddlGroup combo, I get a javascript error saying : " 'null' is null or not an object".
my conclusion is that for some reason my javascript functions cannot be found.
please help me... :(
Thanx,
Revital
p.s.
before putting it all in a user control the combos were on a panel in a web form that contained all the javascript functions and it all worked fine...
I have a web user control containing 2 RadComboBox's - ddlGroup and ddlGorem.
my ascx is as follows:
| <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="InfoOrderForm.ascx.cs" Inherits="Reforma.Web.Application.Hagbalot.InfoOrderForm" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <table width="100%" dir="rtl"> |
| <tr> |
| <td width="20%">קבוצה</td> |
| <td align="right" > |
| <telerik:RadComboBox |
| ID="ddlGroup" |
| OnClientSelectedIndexChanging="LoadGormim" |
| OnItemsRequested="ddlGroup_ItemsRequested" |
| runat="server" |
| Skin="ReformaSkin" EnableEmbeddedSkins="False" |
| > |
| </telerik:RadComboBox> |
| </td> |
| <td width="20%">גורם מבצע</td> |
| <td align="right"> |
| <telerik:RadComboBox |
| ID="ddlGorem" |
| runat="server" |
| OnClientItemsRequested="ItemsLoaded" |
| OnItemsRequested="ddlGorem_ItemsRequested" |
| Skin="ReformaSkin" EnableEmbeddedSkins="False"> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="1" width="20%">המידע המבוקש</td> |
| <td align="right" colspan="3"> |
| <asp:TextBox ID="txtMelel" ReadOnly="false" runat="server" TextMode="MultiLine" Rows="2" Width="100%"></asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td align="left" colspan="2" > |
| <asp:ImageButton ID="btnView" runat="server" |
| ImageUrl="~/ReformaSkin/images/bigarrow_up.gif" BorderWidth="1px" |
| Width="31px" BackColor="Silver" onclick="btnView_Click" ToolTip="בחר" /> |
| </td> |
| <td align="right" colspan="2"> |
| <asp:ImageButton ID="btnAdd" runat="server" |
| ImageUrl="~/ReformaSkin/images/bigarrow_down.gif" BorderWidth="1px" |
| style="margin-right: 0px" Width="31px" BackColor="Silver" |
| onclick="btnAdd_Click" ToolTip="הוסף" /> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="4" align="center"> |
| <ref:CustomGrid ID="alichTzavMeidaGrid" runat="server" CreatedByDesigner="True" EntityID="0" AutoGenerateColumns="false" EnableEmbeddedSkins="False" Skin="ReformaSkin" > |
| <ClientSettings Selecting-AllowRowSelect="true" ></ClientSettings> |
| <MasterTableView PageSize="3" EditFormSettings-EditFormType="AutoGenerated" |
| EditMode="EditForms"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:gridboundcolumn |
| datafield="group" |
| headertext="קבוצה" uniquename="group" MaxLength="10"></telerik:gridboundcolumn> |
| <telerik:GridBoundColumn DataField="gorem" HeaderText="גורם" MaxLength="10" |
| UniqueName="gorem"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="melel" HeaderText="המידע המבוקש" MaxLength="200" |
| UniqueName="melel"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings ColumnNumber="2"> |
| </EditFormSettings> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </ref:CustomGrid> |
| </td> |
| </tr> |
| </table> |
| protected override void OnPreRender(EventArgs e) |
| { |
| if (!Page.ClientScript.IsClientScriptIncludeRegistered("ComboBoxScript")) |
| { |
| Page.ClientScript.RegisterClientScriptInclude( |
| "ComboBoxScript", |
| "ComboBoxScript.js"); |
| } |
| base.OnPreRender(e); |
| } |
| } |
| function ItemsLoaded(combo, eventarqs) |
| { |
| /* var countriesCombo = $find("ddlGorem"); |
| if (combo.get_items().get_count() > 0) |
| { |
| combo.set_text(combo.get_items().getItem(0).get_text()); |
| combo.get_items().getItem(0).highlight(); |
| }*/ |
| alert("ItemsLoaded"); |
| } |
| function LoadGormim(combo, eventarqs) |
| { |
| /*var gormimCombo = $find("ddlGorem"); |
| var item = eventarqs.get_item(); |
| if (item.get_index() >= 0) |
| { |
| gormimCombo.requestItems(item.get_value(), false); |
| }*/ |
| alert("LoadGormim"); |
| } |
both combos load just fine, but as I change the selected index in the ddlGroup combo, I get a javascript error saying : " 'null' is null or not an object".
my conclusion is that for some reason my javascript functions cannot be found.
please help me... :(
Thanx,
Revital
p.s.
before putting it all in a user control the combos were on a panel in a web form that contained all the javascript functions and it all worked fine...