This is a migrated thread and some comments may be shown as answers.
Getting Object doesn't support this action error
1 Answer 26 Views
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 05 Nov 2012, 05:58 PM
First I'll post the code.
Here's the javascript code:

     function sortByStatus() {
 
//             var item = eventArgs.get_item();
             //             var strSort = item.get_value();
             var combo = $find("<%= rcbStatus.ClientID %>");
             var comboItem = combo.get_selectedItem();
             var strSort = comboItem.get_value();
             alert('Selected ' + comboItem.get_value());
 
             if (strSort != 'Active') {
                 window.location = 'meet-the-panel.aspx?paneltype=' + strSort;
             } else {
                 window.location = 'meet-the-panel.aspx';
             }
             
     }


<telerik:RadComboBox ID="rcbStatus" runat="server" Skin="Black" EnableEmbeddedSkins="false" Width="220px" >
                <Items>
                    <telerik:RadComboBoxItem Value="Active" Text="Current Panelists"/>
                    <telerik:RadComboBoxItem Value="alumni" Text="Past Panelists"/>                   
                </Items>
</telerik:RadComboBox>

What this is supposed to do is that when an element is selected run the javascript and go to that page. It works for a few times and then my browser errors with this 'SCRIPT445: Object doesn't support this action' and highlights this line: var a=g?new h(g):new h. At first I thought that the function was not mapping to the combobox and setting the onclientselectedindexchanged on the server side and that did nothing.  I tried setting the autopostback to true and tried it from serverside but I instantly got the same error after one selection. Then I thought that it's not grabbing the value from the box, but from the alert it looked like it was working. The only thing left was the windows.location so I commented that out and I don't receive that error anymore. Something is happening with the redirections that is causing this and I have no idea what it could be. I dont know if this helps but we are using custom skins for this combobox.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 06 Nov 2012, 06:11 AM
Hi Paul,

Unfortunately I couldn't replicate the issue you are facing. One suggestion is that you can redirect the window using linkbutton as follows.

ASPX:
<asp:LinkButton ID="LinkButton1" runat="server" Text=""></asp:LinkButton>

JS:
<script type="text/javascript">
function sortByStatus()
{
  var combo = $find("<%= rcbStatus.ClientID %>");
  var comboItem = combo.get_selectedItem();
  var strSort = comboItem.get_value();
  alert('Selected ' + comboItem.get_value());
  var btn = document.getElementById("LinkButton1");
  if (strSort != 'Active')
  {
   btn.href = 'EmptyMessage.aspx?paneltype=' + strSort;
  }
  else
  {
   btn.href = 'EmptyMessage.aspx';
  }
  btn.click();
}
</script>

Hope this helps.

Thanks,
Princy.
Asked by
Paul
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or