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

RadEditor Image Editor raises an error

5 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Meik Napierski
Top achievements
Rank 1
Meik Napierski asked on 17 Sep 2009, 02:28 PM
Hello,
i am using the Image Manager with a custom FileContentProvider which loads the image from different locations, all functions works fine only the image editor raises an error. When starting the image editor the image is shown and if i try to save the image regardless if the image attributes was changed or not the following error occured in the anonymous javascript function this._onReadyStateChange:

 

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object

with best regards
Meik Napierski

 

 

5 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 22 Sep 2009, 02:54 PM
Hi Meik,

Does the Image editor work with the default content provider? Try it and see if the problem is coming from the provider code or the Image Editor dialog itself.

One possibility for the problem is that you did not implement the StoreBitmap method in your custom provider. Another possibility is that you are not setting all required properties when you create your FileItem/DirectoryItem objects in the content provider code. Take a look at the custom provider example we have and compare it with your code.

All the best,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Meik Napierski
Top achievements
Rank 1
answered on 22 Sep 2009, 03:51 PM
Hi,
the error occurs before the StoreBitmap method will be called. I have overridden all needed methods and the properties should be correct. Can you send me the link where the custom content provider is detailled explained? I only found an example implementing an existing DataBase Provider on your page.

with best regards
Meik Napierski
0
Lini
Telerik team
answered on 23 Sep 2009, 09:00 AM
Hello Meik,

Here are some links from our online documentation that might help you:
Using custom FileBrowserContentProvider
Custom FileBrowserContent Provider
Implementing custom FileBrowserContentProvider that works with physical paths (Code Library article)

Sincerely yours,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Meik Napierski
Top achievements
Rank 1
answered on 30 Sep 2009, 10:17 AM

Hello,
i have debugged all the code before the error occurs. The error occurs in this function:

1: Sys.Net.XMLHttpExecutor =

function Sys$Net$XMLHttpExecutor() {

 

 

2: /// <summary locid="M:J#Sys.Net.XMLHttpExecutor.#ctor" />

 

 

3: if (arguments.length !== 0) throw Error.parameterCount();

 

4: Sys.Net.XMLHttpExecutor.initializeBase(

this);

 

 

5: var _this = this;

 

 

6: this._xmlHttpRequest = null;

 

 

7: this._webRequest = null;

 

 

8: this._responseAvailable = false;

 

 

9: this._timedOut = false;

 

 

10: this._timer = null;

 

 

11: this._aborted = false;

 

 

12: this._started = false;

 

 

13: this._onReadyStateChange = (function () {

 

 

 

14: if (_this._xmlHttpRequest.readyState === 4 ) {

 

 

15: try {

 

 

16: if (typeof(_this._xmlHttpRequest.status) === "undefined") {

 

 

17: return;

 

18: }

19: }

 

20: catch(ex) {

 

 

21: return;

 

22: }

 

23: _this._clearTimer();

24: _this._responseAvailable =

true;

 

 

25: try {

 

26: _this._webRequest.completed(Sys.EventArgs.Empty);

27: }

 

28: finally {

 

 

29: if (_this._xmlHttpRequest != null) {

 

30: _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;

31: _this._xmlHttpRequest =

null;

 

32: }

33: }

34: }

35: });

 

36: this._clearTimer = (function() {

 

 

37: if (_this._timer != null) {

 

38: window.clearTimeout(_this._timer);

39: _this._timer =

null;

 

40: }

41: });

 

42: this._onTimeout = (function() {

 

 

43: if (!_this._responseAvailable) {

 

44: _this._clearTimer();

45: _this._timedOut =

true;

 

46: _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;

47: _this._xmlHttpRequest.abort();

48: _this._webRequest.completed(Sys.EventArgs.Empty);

49: _this._xmlHttpRequest =

null;

 

50: }

51: });

52: }

the error message "Object reference not set to an instance of an object" occurs when calling the method _this._webRequest.completed(Sys.EventArgs.Empty) in Line 26. and this is correct because you initialize the this._webRequest to null in Line 7, so you can't call any method from this object since the object will be correct initialized. I don't understand at this point how the webRequest should be initialized correctly in this context?

with best regards
Meik Napierski

0
Lini
Telerik team
answered on 08 Oct 2009, 12:07 PM
Hi,

The code you have pasted is from the default ASP.NET AJAX client API so there should be no problems with it. In such cases we recommend using Fiddler for IE or Firebug's Net panel for Firefox and looking at the actual response body for the AJAX request. Usually it contains a descriptive error message on what went wrong on the server.

Kind regards,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Meik Napierski
Top achievements
Rank 1
Answers by
Lini
Telerik team
Meik Napierski
Top achievements
Rank 1
Share this question
or