Try our conversational search powered by Generative AI!

Using UIDescriptor to set defaultview causes javascript errors

Vote:
 

Hi!

Following this post: http://world.episerver.com/blogs/Linus-Ekstrom/Dates/2013/12/Customizing-the-look-and-behavior-in-the-UI-for-your-content-types/

I've created the following UIDescriptor, to let all my pages inheriting from BaseViewPage, show in AllPropertiesView:

[UIDescriptorRegistration]
    public class BaseViewPageUIDescriptor : UIDescriptor
    {
        public BaseViewPageUIDescriptor() : base("epi-iconObjectPage")
        {
            DefaultView = CmsViewNames.AllPropertiesView;
        }
    }

However, this results in a massive amount of javascript errors in the console, like:

TypeError: Cannot read property 'appendChild' of null
    at Object.place (dojo.js:15)
    at _13d.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _6a9.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _127b.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _1a2a.addChild (widgets.js:2)
    at Object.addWidgetToRootFunction (widgets.js:2)
    at null. (widgets.js:2)(anonymous function) @ widgets.js:2_2cd @ dojo.js:15dojo.Deferred._2ca.then.then @ dojo.js:15(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_172.map @ dojo.js:15_5e3._createWidgets @ widgets.js:2(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_c8 @ dojo.js:15_36 @ dojo.js:15(anonymous function) @ dojo.js:15_37 @ dojo.js:15_7c @ dojo.js:15_f0 @ dojo.js:15req.injectUrl._10a @ dojo.js:15
widgets.js:2 TypeError: Cannot read property 'tagName' of undefined
    at _68.placeAt (widgets.js:2)
    at _1a2a.addChild (widgets.js:2)
    at Object.addWidgetToRootFunction (widgets.js:2)
    at null. (widgets.js:2)
    at lang.hitch (dojo.js:15)
    at _2f2 (dojo.js:15)
    at Promise._2fe.then._2ff.then [as then] (dojo.js:15)
    at when (dojo.js:15)
    at _5e3._createInternal (widgets.js:2)
    at null. (widgets.js:2)(anonymous function) @ widgets.js:2_2cd @ dojo.js:15dojo.Deferred._2ca.then.then @ dojo.js:15(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_172.map @ dojo.js:15_5e3._createWidgets @ widgets.js:2(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_c8 @ dojo.js:15_36 @ dojo.js:15(anonymous function) @ dojo.js:15_37 @ dojo.js:15_7c @ dojo.js:15_f0 @ dojo.js:15req.injectUrl._10a @ dojo.js:15
5widgets.js:2 TypeError: Cannot read property 'appendChild' of null
    at Object.place (dojo.js:15)
    at _13d.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _6a9.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _127b.addChild (widgets.js:2)
    at _19e (dojo.js:15)
    at _1a2a.addChild (widgets.js:2)
    at Object.addWidgetToRootFunction (widgets.js:2)
    at null. (widgets.js:2)(anonymous function) @ widgets.js:2_2cd @ dojo.js:15dojo.Deferred._2ca.then.then @ dojo.js:15(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_172.map @ dojo.js:15_5e3._createWidgets @ widgets.js:2(anonymous function) @ widgets.js:2lang.hitch @ dojo.js:15_c8 @ dojo.js:15_36 @ dojo.js:15(anonymous function) @ dojo.js:15_37 @ dojo.js:15_7c @ dojo.js:15_f0 @ dojo.js:15req.injectUrl._10a @ dojo.js:15
widgets.js:2 WidgetFactory: Could not resolve one or more widgets

If I uncomment the line DefaultView = CmsViewNames.AllPropertiesView, no javascript errors are thrown.

Am I missing something?

Best regards

Jesper

#139831
Oct 07, 2015 10:50
Vote:
 

EPiServer.CMS.UI 8.6.1

EPiServer.CMS.UI.Core.8.6.1

if that makes any change :)

Using the source javascript files, it seems that the errors are preceeded by this message:

Query is out of date, you must observe() the query prior to any data modifications(…) "Error: Query is out of date, you must observe() the query prior to any data modifications
at /EPiServer/Shell/8.6.1.0/ClientResources/epi/shell/widgets.js:2:475217

... stacktrace...

----------------------------------------
Error
at Promise._2fe.then._2ff.then [as then] (/EPiServer/Shell/8.6.1.0/ClientResources/dojo/dojo.js:15:77181)
... stacktrace...

#139942
Edited, Oct 11, 2015 15:56
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.