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

When using OnClientPageLoad I cannot access web controls, only HTML controls

1 Answer 47 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 16 Sep 2008, 12:47 AM
Hi

I am using Telerik controls 2008 Q2.

I attach an OnClientPageLoad event when opening my RadWindow.

This enters my function. What I try to do next is populate the controls in the RadWindow from a Javascript object.

I can access HTML controls nicely but not web controls, e.g. RadCombobox etc.

$find() always returns null. However if I hide the RadWindow then show it again $find() will work then (however I don't want to do this).

My code:
    var contentFrame = gwinEventDetails.GetContentFrame().contentWindow;

    var VenueTxtBox = contentFrame.$get(contentFrame.gDLGtxtVenueNameID).value

    var VenueCboCountry = contentFrame.$find(contentFrame.gDLGcboVenueCountryID);


The textbox is found but not the combobox (returns null).

Is there something I am missing?


Kind regards

Mark Eaton

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 16 Sep 2008, 07:00 AM
Hi Mark,

Try executing your code with a small timeout - it is possible that in some case OnClientPageLoad to be fired just before all the controls in the page to be loaded.



All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Mark
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or