Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-85224

As a developer, I would like an easy way to register my actions logic against the toolbar that triggers them

    Details

      Description

      Right now, when using the clay:management-toolbar tag, the business logic for actions is usually wired like the following snippet inside the calling jsp

       

      <clay:management-toolbar [...] />
      
      var checkin = function() {
         [...]
      };
      
      var checkout = function() {
         [...]
      };
      
      var deleteEntries = function() {
         [...]
      };
      
      var download = function() {
         [...]
      };
      
      var move = function() {
         [...]
      };
      
      var openDocumentTypesSelector = function() {
         [...]
      };
      
      var ACTIONS = {
          'checkin': checkin,
          'checkout': checkout,
          'deleteEntries': deleteEntries,
          'download': download,
          'move': move,
          'openDocumentTypesSelector': openDocumentTypesSelector
      };
      
      Liferay.componentReady('dlAdminManagementToolbar').then(
          function(managementToolbar) {
              managementToolbar.on(
                  ['actionItemClicked', 'filterItemClicked'],
                  function(event) {
                      var itemData = event.data.item.data;
      
                      if (itemData && itemData.action && ACTIONS[itemData.action]) {
                          ACTIONS[itemData.action]();
                      }
                  }
              );
          }
      );
      

      As a developer, I would like to be able simplify this and keep all the logic in my JS components

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jose.balsas Chema Balsas
                Recent user:
                Csaba Turcsan
                Participants of an Issue:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.1.10 DXP FP3
                  7.1.1 CE GA2
                  7.1.10.1 SP1
                  7.1.X
                  Master