Here is the situation: I wrote a Clientside control, that is composed of the RadTabStrip control, using the ASP.NET AJAX client libraries .
I want my client-side control class to be able to handle events from the client-side TabStrip, like tabSelected.
This is easily done like this:
However, line 9 fails, because the RadTabStrip is a child control of my Composite Control (which implements IScriptControl) and my custom clientside control is $created before the RadTabStrip client-side control is $created.
The easiest solution would be to attach the tabSelected eventhandler for the custom client control instance in the pageLoad() event, but isn't there are smarter way?
Thanks.
I want my client-side control class to be able to handle events from the client-side TabStrip, like tabSelected.
This is easily done like this:
initialize: function() | |
{ | |
MyControls.WizardTabStrip.callBaseMethod(this, 'initialize'); | |
// Add custom initialization here | |
this._tabSelectedHandler = Function.createDelegate(this, this._onTabSelected); | |
// The next line fails, because the client-side TabStrip object is not yet created: it will be created after our custom client-side control is created | |
this.get_tabStrip().add_tabSelected(this._tabSelectedHandler); | |
}, | |
get_tabStripID: function() | |
{ | |
return this._tabStripID; | |
}, | |
set_tabStripID: function(value) | |
{ | |
this._tabStripID = value; | |
}, | |
get_tabStrip: function() | |
{ | |
return $find(this.get_tabStripID()); | |
}, | |
_onTabSelected : function(sender, args) | |
{ | |
// Do things when a tab is selected | |
} |
However, line 9 fails, because the RadTabStrip is a child control of my Composite Control (which implements IScriptControl) and my custom clientside control is $created before the RadTabStrip client-side control is $created.
The easiest solution would be to attach the tabSelected eventhandler for the custom client control instance in the pageLoad() event, but isn't there are smarter way?
Thanks.