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

$find combo.clientid doesn't work in ajaxpanel

3 Answers 84 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Meng Zou
Top achievements
Rank 1
Meng Zou asked on 22 Jan 2009, 11:09 PM
Hi, I have a ComboBox inside a ajaxPanel initially set to visible=false, after ajaxpanel postback, visible=true.

I can see the combo, but I can't get a hold of the the client side reference to the combo using $find('<%=combo.ClientID%>'), however, I am able to find the element using document.getElementById('<%=combo.ClientID%>').

anyone knows how to do this?

this link doesn't help, since ajaxPanel has no FindControl
http://www.telerik.com/help/aspnet-ajax/find-combobox-client-side-embedded-another-control.html

thanks

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 23 Jan 2009, 01:12 PM
Hi Meng Zou,

When RadComboBox is invisible, you cannot get a client-side reference to it (it is not rendered). If it's visible, $find is supposed to work without a problem.

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Meng Zou
Top achievements
Rank 1
answered on 23 Jan 2009, 08:26 PM
i think i found the problem.

after the combo becomes visible in ajax panel (in my case, the asp:panel containing the combo becomes visible), the onClientSelectedIndexChanged event is triggered even before I touch the combo box.

so the event handler is triggered, and in the event handler, i have a $find('<%=combo.ClientID%>').get_value(), which fails to find the client combo reference since it's not created yet on client side.

i don't know why that event is triggered since no index was changed on clientside or server side, it probably shouldn't

--
i do have my reason to use $find('<%=combo.ClientID%>').get_value() in that event handler instead of 'sender'
0
Yana
Telerik team
answered on 26 Jan 2009, 01:59 PM
Hi Meng Zou,

Could you please isolate the issue in a small working example and send it to us so we to be able to test it? You should open a support ticket in order to be able to attach files. Thanks

Regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Meng Zou
Top achievements
Rank 1
Answers by
Yana
Telerik team
Meng Zou
Top achievements
Rank 1
Share this question
or