I've found myself in a bit of a dilemma - it seems that solving this issue will require some restructuring of my code. The situation involves a server-side timer running that needs to emulate clicking a tab on a RadTabStrip.
On the client side, I have the following method:
function OnClientTabSelected(sender, eventArgs)
{
FixSplitter($find(rightPaneID));
}
However, the FixSplitter function relies on an additional control:
function FixSplitter(sender, eventArgs)
{
var multiPage = $find(multiPageID);
...
}
Meanwhile, on the server side, the following code snippet is executed:
public void DoTimerCycleTick(object sender, TimerEventArgs eventArgs)
{
GlobalSettings globalSettings = StateManager.GetStates<GlobalSettings>();
if( globalSettings.CycleEnabled )
{
// Logic for cycling through tabs
}
}
The part where indices are set does not trigger the OnClientTabSelected
method as desired. This brought me to consider registering a client script, however, due to its dependence on MultiPage within an UpdatePanel causing issues with identification using $find(multiPageID).
Are there any alternatives to creating a new method to achieve the same tasks and generate a postback after execution rather than updating the UpdatePanel server-side?
I understand there are deeper underlying problems with this setup, but I'm unable to refactor the code for a few more weeks.
UPDATE: After some brainstorming, here's a potential solution I came up with. Open to suggestions, as coding isn't my strong suit:
// Function for timer tick
public void DoTimerCycleTick(object sender, TimerEventArgs eventArgs)
{
GlobalSettings globalSettings = StateManager.GetStates<GlobalSettings>();
if( globalSettings.CycleEnabled )
{
// Revised logic for tab cycling
}
}
// Additional JavaScript function for handling tab change
var showLoadingPanel = true;
function OnServerTabSelected(newIndex) {
// Implementation details...
return;
}