AnsweredAssumed Answered

Custom toolbar action button

Question asked by darkredd on Jun 29, 2015
Latest reply on Sep 29, 2015 by raghav.bhardwaj
Hi all,

I searched throughout forums looking for tutorials and found a lot which helped me get to where I am now. I want to add a custom button on the DocLib toolbar but have been unsuccessful with all the tutorial I went through, the button still does not show. Here is what I have now. I am currently editing the Alfresco OOTB files (I will create extension files later).

toolbar.js file:

onReady: function DLTB_onReady()
{
  […]
  this.widgets.exportToCSV = Alfresco.util.createYUIButton(this, "exportToCSV-button", this.onExportToCSV,
  {
     disabled: true,
     title: this.msg("button.exportToCSV")
  });
  this.dynamicControls.push(this.widgets.exportToCSV);
  […]
}

onExportToCSV: function DLTB_onExportToCSV(e, p_obj)
{
  Alfresco.util.PopupManager.displayMessage(
  {
    text: this.msg("Export Button Clicked", "Export Button Clicked")
  });
},


toolbar.lib.ftl file:

<div class="hideable toolbar-hidden DocListTree">
  <div class="export-To-CSV">
   <span id="${id}-exportToCSV-button" class="yui-button yui-push-button">
     <span class="first-child">
       <button name="exportToCSV">${msg("button.export_ToCSV")}</button>
     </span>
   </span>
  </div>
</div>


At this time all I need is for the button to appear and popup a message when clicked. Is there something I am significantly missing.
Using Alfresco v4.2.2

Outcomes