[DevExpress Support Team: This ticket is cloned from ticket T114994: Java Exception on every page in IE11]
Hi, I too have the same problem with this component in asp.net. From the v14.1.3 version (V2014 vol 1.3) - Released on 3-June-2014, adding attributes <dx: ASPxHtmlEditor ID = "ASPxHtmlEditor1" runat = "server" Settings-AllowDesignView = "False" Settings-AllowHtmlView = "False"> shows the following error in IE running.
Unhandled exception in line 37532, column 3 http://localhost:1376/DXR.axd?r=1_171,1_94,1_164,1_104,1_166,1_139,1_138,1_114,1_121,1_98,1_125,1_152,1_91,1_156,1_162,1_147,1_155,1_93,1_165,1_100,5_5,5_4,4_11,4_10,4_6,4_7,4_9-ynfV8
0x800a138f - Runtime Error in JavaScript: Can not get 'ownerDocument' property null reference or undefined
ASPxHtmlEditor - "Can not get 'ownerDocument' property null reference or undefined "JavaScript exception in IE11
Answers
Hi All,
I think, there is a bug in v14.1.3 especially at XAF
ERROR:
A javascript exception will appear like that:
"Runtime Error in JavaScript: Can not get 'ownerDocument' property null reference or undefined"
DESCRIPTION:
If you editor displays ONLY Preview Mode this error occurs.
In the XAF, you can reproduce this error like that :
if (you are bind an ASPxHtmlEditor to Domain Object Field)
and
(
if you're in DetailView mode as View (Not Edit so it means Read-Only Mode)
or
if your Detail View Field is Read-Only (via Add Column in Model Editor)
)
then
Your ASPxHtmlEditor will be Read-Only.
So it will not show Design View and Html View as a Read-Only
And if you are enter to DetailView and do some things you will that BOOOOOOOM.
WORKAROUND SOLUTION:
You must set TRUE one of views DesignView or HtmlView WHEN the editor Created.
C#editor.Settings.AllowDesignView = true;
or
editor.Settings.AllowHtmlView = true;
Ofc you can set the other values to more user friendly as a read-only field. For Example:
C#editor.ActiveView = HtmlEditorView.Preview; editor.Settings.AllowContextMenu = DevExpress.Utils.DefaultBoolean.False; editor.ToolbarMode = HtmlEditorToolbarMode.None;
You may create a sample ViewController for the ASPxHtmlEditor like this:
C#public class HTMLEditorController : ViewController<DetailView>
{
protected override void OnActivated()
{
base.OnActivated();
if (View.ViewEditMode == DevExpress.ExpressApp.Editors.ViewEditMode.Edit)
{
foreach (ASPxHtmlPropertyEditor pe in View.GetItems<ASPxHtmlPropertyEditor>())
{
if (pe.Control == null)
{
pe.ControlCreated += new EventHandler<EventArgs>(pe_ControlCreated);
}
else
{
CustomizeEditorControl(pe, pe.Editor);
}
}
}
}
protected override void OnDeactivated()
{
if (View.ViewEditMode == DevExpress.ExpressApp.Editors.ViewEditMode.Edit)
{
foreach (ASPxHtmlPropertyEditor pe in View.GetItems<ASPxHtmlPropertyEditor>())
{
pe.ControlCreated -= new EventHandler<EventArgs>(pe_ControlCreated);
}
}
base.OnDeactivated();
}
void pe_ControlCreated(object sender, EventArgs e)
{
ASPxHtmlPropertyEditor pe = (ASPxHtmlPropertyEditor)sender;
if (pe!=null)
CustomizeEditorControl(pe, pe.Editor);
}
private static void CustomizeEditorControl(ASPxHtmlPropertyEditor pe, ASPxHtmlEditor editor)
{
if (editor != null)
{
editor.SettingsImageUpload.UploadImageFolder = "~/Images/Uploads";
if (pe.AllowEdit == false)
{
editor.Settings.AllowDesignView = true;
editor.ActiveView = HtmlEditorView.Preview;
editor.Settings.AllowContextMenu = DevExpress.Utils.DefaultBoolean.False;
editor.ToolbarMode = HtmlEditorToolbarMode.None;
}
}
}
}
Best Regards Mert Eşsiz
Hello,
Thank you for this solution, Mert. I believe that it will be helpful for other users.
Hi Carlos,
Would you please describe the issue you have encountered in greater detail?
- What does the issue look like? Would you please make a detailed screencast that illustrates how to reproduce this issue from scratch? For example, use the Jing tool for this purpose;
- Specify detailed information about the browser: make a screenshot of the "Help -> About …" dialog, and clarify the IE Browser/Document mode settings (press the F12 key to invoke the Dev Toolbar);
- Send us your page ASPx markup and code snippets. Alternatively, provide us with a simple working project that illustrates the issue in action. With a small example project, it is much easier for us to verify that the code that calls ours is valid, and that the way our controls are being used is recommended. This way, we can concentrate our resources on the problematic area:
A request for simple example programs
Your time and cooperation are greatly appreciated.
Waiting for the new version were fixed this problem, but still the same.
This only happens in internet explorer with ASPxHtmlEditor component and attributes Settings-AllowDesignView = "False" Settings-AllowHtmlView = "False".
It is urgent that this error to continue working is fixed.
My English is not very good but I think you will understand me.
Thank you
Hello Carlos,
I've created a simple project based on your description, but wasn't able to reproduce the problem (see the attached video). Would you please modify my project to illustrate the issue? In addition, specify the browser family/version:
- Detailed information about the browser: make a screenshot of the "Help -> About …" dialog;
- Browser/Document mode settings - press the F12 key to invoke the Dev Toolbar;
Note that if your page is displayed under specific Browser/Document settings, it's necessary to manually adjust our controls using the approach from p.2 of the How to adjust DevExpress ASP.NET controls when opening a page in the Internet Explorer Compatibility Mode article.
Thanks,
Artem