This is a migrated thread and some comments may be shown as answers.

ListBox inside a ListBox Javascript error

1 Answer 25 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Ben Thies
Top achievements
Rank 1
Ben Thies asked on 24 Mar 2010, 11:52 PM
Hi guys,

I am using a RadListBox inside the ItemTemplate of a RadListBox. Sometimes when selecting, reordering or deleting an Item from the inner ListBox, a javascript error is thrown: "Microsoft JScript runtime error: 'f.getItem(...)' is null or not an object".

This happens in the Telerik javascript line: 

d.each(

this._selectedIndices,function(){if(this!=e){f.getItem(this)._setSelected(false);

What it seems to me, is that it is trying to deselect an item from the outer RadListBox, which does not exist.

Short of me adding a null check to your javascript library, can you suggest a way to resolve this problem?

NOTE: I am using Q1 2010 release.

Thanks,

Ben.

My code is:

 

 

<telerik:RadListBox ID="lbSelectedTeamStaff"

 

 

Width="300px"

 

 

runat="server"

 

 

AllowDelete="True"

 

 

AllowReorder="True"

 

 

AutoPostBackOnReorder="True">

 

 

 

 

 

<ButtonSettings ReorderButtons="Common" />

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<div class="ComboTemplate">

 

 

 

 

 

<strong>

 

 

 

 

 

<asp:Label ID="lblSelectedTeamName" runat="server"></asp:Label>

 

 

 

 

 

</strong>

 

 

 

 

 

<br />

 

 

 

 

 

<div id="rosterSelectedStaff" class="ComboDetails">

 

 

 

 

 

<telerik:RadListBox ID="lbSelectedStaff" runat="server" AllowDelete="True"

 

 

AllowReorder="True" BorderStyle="None" BorderWidth="0px"

 

 

EnableDragAndDrop="true" >

 

 

 

 

 

<ButtonSettings ReorderButtons="Common" ShowDelete="true" ShowReorder="False" />

 

 

 

 

 

 

</telerik:RadListBox>

 

 

 

 

 

</div>

 

 

 

 

 

</div>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:RadListBox>

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 25 Mar 2010, 08:55 AM
Hi Ben Thies,

Placing one listbox inside the item template of another listbox is not a supported scenario.

Regards,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ListBox
Asked by
Ben Thies
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or