cancel
Showing results for 
Search instead for 
Did you mean: 

Custom toolbar action button

darkredd
Star Contributor
Star Contributor
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
1 REPLY 1

raghav_bhardwaj
Champ on-the-rise
Champ on-the-rise
Hi please check the above url ,hope this will help you  .

http://docs.alfresco.com/4.0/tasks/tu_40_add-content.html

Please mark comment as useful if it helps you


Raghav Bhardwaj