AnsweredAssumed Answered

Bean is not recognized

Question asked by theobroma on Dec 7, 2017
Latest reply on Dec 12, 2017 by theobroma

I have configured new multi-select button in the document library:





When the button is clicked it should execute javascript function onActionAddToList which later calls bean function. Everything works except bean function insert, it is not called/recognized since listManagement is not found. Am I doing something wrong? I am wondering if I should configure bean in an other place? I'm using Alfresco 5.2.0 SDK 3.0.1 Below you can find corresponding code:


1. /alfresco/web-extension/site-data/extensions/my-extension.xml   -> share-jar

   <config evaluator="string-compare" condition="DocumentLibrary">
         <action type="action-link" id="onActionAddToList" icon="document-approve" label="Add item to a list" />
   <config evaluator="string-compare" condition="DocLibCustom" replace="true">
         <js src="/components/documentlibrary/custom-documentlibrary-actions.js" />


2. resources/components/documentlibrary/custom-documentlibrary-actions.js ->  share-jar"registerAction", {
   actionName: "onActionAddToList",
   fn: function custom_onActionAddToList(record)
         Alfresco.util.PopupManager.displayMessage({ title: "Info", text: listManagement.insert("Hello")});


3. alfresco/module/project/context/service-context.xml -> platform-jar

   <bean id="com.test.actions.ListManagement" class="com.test.actions.ListManagement"       parent="baseJavaScriptExtension">
      <property name="extensionName" value="listManagement"/>


4. java/com/test/actions/ -> platform-jar

public class ListManagement extends BaseProcessorExtension {

   public String insert(String text) {

      return text;