I have a simple RadSplitter page with a variable number of panes; in each pane, a local ASPX page is rendered that shows a map of the UK with a graph of data overlaid on top. The map is the same for every pane but the graphs of data vary: e.g., in the first pane I have data from 1983, in the second data from 1990, and so on. I am constructing the RadSplitter (rsMaps) on the server like this:
So far so good -- the URL of each pane is read from the Request string (of the page containing the RadSplitter) and the content is subsequently loaded. However, the data graphs are getting mixed up! The results are random but generally what happens is that two of the panes will show the same graph (e.g. for 1983) and some graphs will not be shown at all (e.g. 1990). I think this is because the panes are loaded simultaneously (in parallel) and that the page is becoming confused somehow. Therefore I wanted to try loading the panes in sequence (so that one pane must have finished loading before the next one starts) rather than in parallel, to see if that might fix it.
My question, then, is as follows: Can I set the content URLs on the client and force the panes to load one at a time? I was trying to do something like this, where the OnClientLoaded event of the RadSplitter is handled by the function below:
Any insights would be gratefully received!
Ed Graham
// add a new pane (in the splitter) for each map
for
(
int
i = 0; i < _numMaps; i++)
{
if
(i > 0)
{
// add splitter-bars in between each map
RadSplitBar rsb =
new
RadSplitBar();
rsMaps.Items.Add(rsb);
}
RadPane rp =
new
RadPane();
// set URL
rp.ContentUrl = _mapUrlBase + Request.QueryString[
"URL"
+ i.ToString()] +
"&MultiMap=true&Title="
+ Request.QueryString[
"Title"
+ i.ToString()];
rsMaps.Items.Add(rp);
}
So far so good -- the URL of each pane is read from the Request string (of the page containing the RadSplitter) and the content is subsequently loaded. However, the data graphs are getting mixed up! The results are random but generally what happens is that two of the panes will show the same graph (e.g. for 1983) and some graphs will not be shown at all (e.g. 1990). I think this is because the panes are loaded simultaneously (in parallel) and that the page is becoming confused somehow. Therefore I wanted to try loading the panes in sequence (so that one pane must have finished loading before the next one starts) rather than in parallel, to see if that might fix it.
My question, then, is as follows: Can I set the content URLs on the client and force the panes to load one at a time? I was trying to do something like this, where the OnClientLoaded event of the RadSplitter is handled by the function below:
function
LoadPanes(sender)
{
var
rsMaps = sender;
var
panes = rsMaps.getPanes();
for
(
var
i = 0; i < panes.length; i++)
{
var
pane = panes[i];
var
contentUrl = getContentUrl(i);
// this would come from the Request String
pane.set_contentUrl(contentUrl);
// >>>> PSEUDO-CODE: this is the bit I'd like to do <<<<
while
(!pane.HasFinishedLoading)
{
sleep(1000);
}
}
}
Any insights would be gratefully received!
Ed Graham