Ticket T257121
Visible to All Users

JavaScript error in ASPxClientMenu: 0x800a138f - Ошибка выполнения JavaScript: Не удалось получить свойство "constructor" ссылки, значение которой не определено или является NULL

created 10 years ago

Hello!
In our project we have our CustomAction that inherited from PopupWindowShowAction . Also we realized our ActionContainerHolder (MyActionContainerHolder) and MenuActionItem (CustomMenuActionItem). CustomMenuActionItem creates ASPxDropDownEdit that contains our template to show DetailView with other action. During page loading we have JavaScript Error " 0x800a138f - Ошибка выполнения JavaScript: Не удалось получить свойство "constructor" ссылки, значение которой не определено или является NULL" in method MenuRenderHelper.InlineInitializeItemElement at line "prepareItemOnClick = parentItemData[visibleIndex].constructor == Array".
Is there any goog solution to solve this problem?
I've attached a small solution that demonstrates current issue. To reproduce it - just run this project.

Comments (3)
DevExpress Support Team 10 years ago

    Hello Dzmitriy.

    Please accept our apologies for the delay in responding. We couldn't find an immediate answer or resolution. Please bear with us. We will inform you as soon as an answer is found.

    DevExpress Support Team 10 years ago

      Hello Dzmitriy,

      The exception is caused by the "OK" and "Cancel" buttons placed in the PopupActions WebActionContainer from your Template.ascx. These buttons are identified as MainMenu elements, while they are not. It looks like the PopupWindowShowAction is incorrectly used in this case. Would you please clarify your final goal, use cases of the CustomMenuActionItem, and the control look and feel? I am looking forward to your reply.

      Thanks,
      Marina

      DS DS
      Dzmitriy Shirko (Xafari Team) 10 years ago

        Hello Marina!
        We are using PopupWindowShow action just to not implement all helping methods, events and fields (such as CustomizePopupWindow event). And our action used instead PopupWindowShowAction in some cases where we think that our action would be simplier for users.

        Answers approved by DevExpress Support

        created 10 years ago

        Hello Dzmitriy,

        The ActionContainerHolder uses the ASPxMenu as a control. Your CustomMenuActionItem is inherited from the TemplatedMenuActionItem class. TemplatedMenuActionItem sets its MenuItem.Template = this. At the same time, TemplatedMenuActionItem is instantiated as an ASPxDropDownEdit that contains another ASPxMenu in DropDownWindowTemplate. As it is stated in the MenuItem.Template Property article: "A Template cannot contain another menu control." So, this scenario is unsupported. Feel free to contact us if you have more questions.

        Thanks,
        Marina

          Show previous comments (1)
          DevExpress Support Team 10 years ago

            Hello Dzmitriy,

            Would you please specify the version of our components where everything works fine? It will be useful if you provide a working sample project with that version. Is the popup window with "OK" and "Cancel" buttons required for your final goal? I am asking this because removing the "PopupActions" WebActionContainer from Template.ascx will eliminate the exception. I am looking forward to your reply.

            Thanks,
            Marina

            DS DS
            Dzmitriy Shirko (Xafari Team) 10 years ago

              Hello Marina,
              There is previuos project converted to 14.2.7 build wich doesn't generate javascript exception and works as needed.

              DevExpress Support Team 10 years ago

                Hello Dzmitriy,
                Thank you for your time and sample project.
                I regret to inform you that there is no way to avoid the limitation described in the MenuItem.Template Property article. Your implementation should not work originally.
                The best approach is to remove the "PopupActions" WebActionContainer from Template.ascx and add a button to handle clicks and execute your logic.
                Please let us know if you need further assistance.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.