cancel
Showing results for 
Search instead for 
Did you mean: 

Aikau: need to customize AlfList operation failure notification.

rohit_chakrabor
Champ on-the-rise
Champ on-the-rise
Hi, I want to change the "alfresco/lists/AlfList" failure notification from "Operation Failed" to "Refresh the page" in the custom share page
or I don't need to show any notification.

How can I achieve this using aikau.
any suggestion.

this is my code:

name: "alfresco/lists/AlfList",
      config: {
         pubSubScope: folderArray,
            loadDataPublishTopic: "ALF_CRUD_GET_ALL",
            refreshCurrentItem: true,
            loadDataPublishPayload: {          
            url: "slingshot/doclib/treenode/site/" + siteId + "/documentLibrary/" +  folderArray,
            refreshCurrentItem: true
         },
         itemsProperty: "items",
         /*widgetsForDataFailureDisplay: [{
            name: "alfresco/notifications/AlfNotification",
            config: {
               lable: "refresh"
            }
         }],*/
         widgets:[{
                 name: "alfresco/lists/views/AlfListView",
                 config: {
                    widgets: [{
                        name: "alfresco/documentlibrary/views/layouts/Row",
                        config: {
                           widgets: [{
                              name: "alfresco/documentlibrary/views/layouts/Cell",
                               config: {
                                  widgets: [{
                                     name: "alfresco/renderers/PropertyLink",
                                    config: {
                                       propertyToRender: "name",
                                        publishTopic: "SELECTED_DATA_LIST"
                                     }
                                  }]
                               }
                           }]
                        }
                    }]
                 }
         }]
      }
   };

Thanks in advance.
2 REPLIES 2

rohit_chakrabor
Champ on-the-rise
Champ on-the-rise
Hi,
do I need to create a custom widget to overwrite the failure message(what could be the code snippet) or
  can I configure in alfresco/lists/AlfList widget config section.

thanks.

ddraper
World-Class Innovator
World-Class Innovator

The "Operation Failed" message is actually generated from the CrudService, not from the AlfList. The display of the message is actually handled by the NotificationService.

When publishing a request to the CrudService you can include "successMessage" and "failureMessage" attributes which will be displayed instead of the generic messages.

Therefore to achieve the display of a different message on failure, then you just need to include a "successMessage" attribute in your "loadDataPublishPayload" object.