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

RADAjaxManager and Composite Controls

9 Answers 156 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Doug Beard
Top achievements
Rank 2
Doug Beard asked on 19 Feb 2008, 06:09 PM
My work requires me to create composite controls on a regular basis.  Often I want these controls ajaxified.

But, I'm having trouble using the RadAjaxManager in a composite control.
I've done an exhaustive search through these forum and find others encountering similar problems with dissimiliar project requirements, but the solutions suggested either don't apply or don't work.

First Question:
In a Custom Composite Control, how does one check for the existence of a RadAjaxManager on the page and when does one do it. 

Second Question:
I do some recursive enumerations to find the RadAjaxManger on the page, currently.  Its ugly, but it works.  However, each time I reference the RadAjaxManager already existent on the page, the AjaxSettings count of said reference = 0, even though I've added AjaxSettings previously and those settings work seem to work.

After obtaining said reference, I then attempt (in the Composite Control ) to add AjaxSettings to the manager.  If I attempt this in the Composite Control's OnInit I get 'Object not set to an Instance of an Object', although all objects involved are indeed NOT NULL.

If I make the same attemp in the Composite Control's OnLoad, I get an error claiming that the Page object can not be null.  I didn't pass in a page object, the RadAjaxManager was already on the page and I got a reference to it.  This error doesn't seem to detail the actual problem.

I can not isolate the problem into a test project because of the project's requirements.

Anyone have any suggestions how to use RadAjaxManager from customer Composite Controls?

9 Answers, 1 is accepted

Sort by
0
Doug Beard
Top achievements
Rank 2
answered on 19 Feb 2008, 08:22 PM
EDIT: Removed after further findings...


0
Doug Beard
Top achievements
Rank 2
answered on 20 Feb 2008, 09:19 PM
Check that, the problem rears again.

I don't have any clue why, but the RadAjaxManager does not like to be used in a composite control.

Please feedback on this issue is greatly appreciated.
0
Doug Beard
Top achievements
Rank 2
answered on 21 Feb 2008, 02:36 PM
It appears, not many are familiar with the use of the RAD Ajax Manager control in composite or custom controls.  Charting new ground I guess.

Here's what I've found on this issue. 

It's very important to insure that the Ajax Manager is added to the Page.Form object prior to OnLoad.  OnInit is the most obvious choice for this.  Otherwise, you may encounter both Page null errors and Object not set to an object instance exceptions when attempting to add AjaxSettings to the Ajax Manager.

This creates a HUGE challenge if the developer's intent is to include the Rad Ajax Manager in his composite control payload.  Choosing to include the Rad Ajax Manager in the composite control payload restrict at which point in the page lifecycle the composite control can be instantiated.

Can anyone from Telerik confirm this issue and expound upon it?




0
Rosen
Telerik team
answered on 22 Feb 2008, 09:46 AM
Hello Doug Beard,

You can get reference to the RadAjaxManager through its static method GetCurrent.

Can you please give us more details on the exact case in which you find difficulties using RadAjaxManager?

To your question, if I have got it right -- yes, you have to add RadAjaxManager before any control tries to use it. I have attached a simple project where similar scenario is demonstrated. Please, feel free to modify it, to better fit your needs.

Regards,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 22 Feb 2008, 02:12 PM
Nah, per my comment, I am in fact adding the RadAjaxManager before any controls that use it, that's not the problem.

You've completely missed the point. 

Again, in the scenario you've chosen to attach, the RadAjaxManager is added to the PAGE!!! Not through the composite control.  The composite control you've attached simply checks for the RadAjaxManager and errors if one does not exist.  This is not what I'm looking for.

As I said above:
What if the developer chooses to include the RadAjaxManager with the composite control payload.  We can not ensure that the consumer of the composite control has placed a RadAjaxManager on the page and telling them to add one is not a adequate solution.
0
Rosen
Telerik team
answered on 22 Feb 2008, 05:08 PM
Hi Doug,

Dynamically adding  RadAjaxManager through the page from custom controls is not supported at this time. I suggest, if it is appropriate in your scenario, to use RadAjaxPanel instead. 

Best regards,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 22 Feb 2008, 05:22 PM
Panels are not an acceptable solution in my case.
Will this be addressed?
0
Rosen
Telerik team
answered on 25 Feb 2008, 11:38 AM
Hello Doug Beard,

This issue is logged in our database and therefore most probably will by addressed in one of the future releases of the Prometheus controls.
Excuse us for the inconvenience.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 25 Feb 2008, 02:04 PM
Great to hear.
Tags
Ajax
Asked by
Doug Beard
Top achievements
Rank 2
Answers by
Doug Beard
Top achievements
Rank 2
Rosen
Telerik team
Share this question
or