BerwickHeightsSoftware

Building Quality Into Enterprise Software

Welcome to Berwick Heights Software Sign in | Join | Help
in Search

Stuart Jones Weblog

Rico Drag-N-Drop

I was using the drag-n-drop feature of the Rico Ajax library the other day and noticed that the feature was not working in Internet Explorer, where I was getting this error:

Microsoft JScript runtime error: 'document.defaultView' is null or not an object

In Firefox, I was seeing this error in the Javascript console:

Error: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: http://localhost/Ajax/AjaxJSLibs/rico.js :: anonymous :: line 2644"  data: no]
Source File:
http://localhost/Ajax/AjaxJSLibs/rico.js
Line: 2644

Upon closer inspection, I noticed that the problem was buried deep inside of a Rico utility function that was using introspection to set HTML element properties. I realized that it was trying to work with the background-color style for the element, but this was not set in my CSS for the element, so it was referencing a null value. The fix was to make sure that the elements that are set up as the Rico draggables and dropzones have the CSS background-color property set.

This makes sense, once I realized what was going on. The background color changes for both the dragged item and the drop zones while the item is dragged. The Rico library needs to save the original background color so that it can be reset once the dragging is done.

So, when using the Rico drag-n-drop feature, make sure you set the background-color style for the draggable and dropzone HTML elements.

Published Thursday, October 26, 2006 8:49 PM by stuart
Filed Under:

Comments

No Comments
New Comments to this post are disabled

This Blog

Post Calendar

<October 2006>
SuMoTuWeThFrSa
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

Syndication

Powered by Community Server, by Telligent Systems