I was having some trouble with the RadChart inside a RadAjaxPanel.
When I was using a button to trigger an ajaxRequest on the RadAjaxPanel, it worked once, then the $find(<%= RadAjaxPanel1.ClientID %>) is null. I tested this without the chart just to see the baseline, and it still failed to be capable of doing ajaxRequest more than once.
I hope I didn't miss something where this isn't capable of being called multiple times, or else this is a waste of a big post. :)
I've worked up a very simple version setup that reproduces the issue, so hopefully a solution can be found, or I get to find another charting tool...
Now; how to recreate the issue:
First, My Setup
Visual Studio 2010 Professional
Windows 7 Enterprise
Second, The Steps
Open Visual Studio
.NET Framework 4
ASP.NET Web Application [Visual C#]
Replace the contents of BodyContent with
At the top add
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
Add Reference to the Telerik.Web.UI.dll
Register the RadScriptManager in web.config [using the lovely automated method attached to the RadScriptManager]
Add after the Page_Load function
Build the project
Browse Default.aspx in FireFox [I use CTRL+F5 and have FF as my default browser]
Activate and Refresh the page for FireBug
Go to Console in FireBug
Enter the line $find(panel).ajaxRequest("test1"); [Note that 'panel' is the variable we put the RadAjaxPanel1.ClientID into]
The result will be a Post entry at the top of the console pane.
At this point the label will now have 'test1' appended, making the full text 'texttest1'
Returning to the Console in FireBug
Enter the line $find(panel).ajaxRequest("test2");
Here is where we get the error - It says that $find(panel) is null. The behavior I'm expecting is for another Post to occur and the label text be updated to be 'texttest1test2'.
To test this, we use the Console and enter
We get the result - "MainContent_RadAjaxPanel1" so we know that it hasn't been blanked.
We can also use the Console with the line
document.getElementById(panel); and we see that it does still exist on the page.
At this point, to test a little further, I installed FireQuery 0.7 [allows FireBug to add jQuery to a page to make it nice and simple to do things from the Console] and decided to see what would occur when I enter
$('#' + panel); and the result is a jQuerified div. I can do hide()/show() and it responds.
I have checked the value of panel in the HTML in Firebug after the page loads, before any post backs and from the Console using panel
var panel = 'MainContent_RadAjaxPanel1';
and then again after causing an ajaxRequest from the Console; and they remain the same.
That's what I have for this so far. I hope I'm not missing something simple and stupid, as I'm wont to do that. I got it as simple as I could and still have the problem.
Since I'm working on a project where users can select what data to display... I kinda need to be able to trigger multiple postbacks. This hiccup has me stumped and prevents me from moving forward with the RadChart. Hopefully we'll have a quick solution and I'm an idiot, but... umm... Yea, until then - Helpz!
P.S. I've attached a picture showing the error output in FireBug.