Version: v8.3p_2013-06-01/PowerEdition Deployment
Browser: Embedded .net control (IE8 installed on XPSP3)
Re-creating this will not be easy, but my proposed fix does work in my case!
We have a window with an embedded .net control that is displaying a SmartClient page that has a DynamicForm with an UploadItem in it. The window pops up and the page loads immediately.
[ATTACH]5981[/ATTACH]
The bug: if the first thing the user clicks on in the browser control is either the 'Browse...' button or the rectangle immediately to the left of the 'Browse...' button, then they get a JS 'Unspecified error'.
If they click anywhere else on the page first and then click the 'Browse...' button, they don't get the error.
I traced the code back to:
Very strangely, it seems to be the actual accessing of the selection.type that causes the error to be thrown.
If I insert
I can see that the 'type' key exists, but if I insert
then I get the error thrown.
I broke the var statement into separate lines to confirm where the error was being thrown:
Googling 'document.selection.type unspecified error' I found:
http://dev.ckeditor.com/ticket/9034
Which seemed to be related.
In the end, their solution of wrapping in a try catch worked:
I have wrapped the whole of obfuscated isc.Element.$mk in a try catch so as to avoid problems when upgrading SmartClient, but I'd love if you were to incorporate a fix into the source code!
Browser: Embedded .net control (IE8 installed on XPSP3)
Re-creating this will not be easy, but my proposed fix does work in my case!
We have a window with an embedded .net control that is displaying a SmartClient page that has a DynamicForm with an UploadItem in it. The window pops up and the page loads immediately.
[ATTACH]5981[/ATTACH]
The bug: if the first thing the user clicks on in the browser control is either the 'Browse...' button or the rectangle immediately to the left of the 'Browse...' button, then they get a JS 'Unspecified error'.
If they click anywhere else on the page first and then click the 'Browse...' button, they don't get the error.
I traced the code back to:
Code:
_getElementFromSelection : function (doc) { if (!doc) doc = document; if (isc.Browser.isIE ) { var selection = doc.selection, type = selection.type.toLowerCase(), isText = (type == "text" || type == "none");
If I insert
Code:
alert(isc.getKeys(doc.selection));
Code:
alert(isc.getValues(doc.selection));
I broke the var statement into separate lines to confirm where the error was being thrown:
Code:
_getElementFromSelection : function (doc) { if (!doc) doc = document; if (isc.Browser.isIE ) { // alert(isc.getKeys(doc.selection)); // works // alert(isc.getValues(doc.selection)); // throws error var selection = doc.selection; var type = selection.type; // This is the line that throws the error type = type.toLowerCase(); var isText = (type == "text" || type == "none");
http://dev.ckeditor.com/ticket/9034
Which seemed to be related.
In the end, their solution of wrapping in a try catch worked:
Code:
if (isc.Browser.isIE ) { var selection = doc.selection; try { var type = selection.type.toLowerCase(); } catch(err) { return null; } var isText = (type == "text" || type == "none");
Comment