How launch actions/handler from share (MenuItem or widget)?

Showing results for 
Search instead for 
Did you mean: 

Re: How launch actions/handler from share (MenuItem or widget)?

i have try many code with AlfMenuItemMixin without succes. I cannot get display, alle menu is display without this entry :

if (headerMenu != null) {
    logger.log("find HEADER_APP_MENU_BAR");
        id: "HEADER_ACTION_LINK",
        name: "alfresco/menus/AlfMenuBarPopup",
        config: {
            id: "HEADER_ACTION_LINK",
            label: "",
            widgets :[
                       id: "HEADER_ACTION_inline-editable_BUTTON",
                       name: "alfresco/menus/AlfMenuItemMixin",
                            id: "HEADER_ACTION_inline-editable_BUTTON",
                               label: "header.item.inline-editable",
                                iconClass: "delete-16",
                              propertyToRender: "title",
                              altText: "??",
                              publishTopic: "ALF_CRUD_POST",
                              publishPayloadType: "PROCESS",
                              publishPayload: {
                                 requiresConfirmation: true,
                                 url: "share/proxy/alfresco/api/actionQueue",
                                 confirmationTitle: "Launch action",
                                 confirmationPrompt: "Are you sure you want to launch '{title}'?",
                                 successMessage: "Successfully launch '{title}'"
                              publishPayloadModifiers: ["processCurrentItemTokens", "convertNodeRefToUrl"]

Have you an idea of my error?


Re: How launch actions/handler from share (MenuItem or widget)?

I did not say to literally use "alfresco/menus/AlfMenuItemMixin". The "alfresco/header/AlfMenuItem" you used initially is an extension of "alfresco/menus/AlfMenuItemMixin" and as such supports publishing events. So, simply use "alfresco/header/AlfMenuItem" and configure that with the publish topic etc.

Note that "propertyToRender" is inapplicable to any element in a menu. You also cannot expect "processCurrentItemTokens" to work, because the header menu does not have a "currentItem" state variable.

I can only advise to work through the Aikau tutorial and to use the JSDoc of the modules to better understand them.