2017-12-07 22 views
0

을 인식하지 : 버튼이 나중에 빈 함수 삽입을 호출하는 자바 스크립트 함수의 onActionAddToList을 실행해야 클릭프레스코 빈은 내가 문서 라이브러리에 새로운 멀티 선택 버튼을 구성한

enter image description here

. bean 함수를 제외한 모든 것이 작동합니다 - 호출되거나 인식되지 않습니다. 내가 뭔가 잘못하고 있는거야? 콩을 다른 장소에서 구성해야하는지 궁금합니다. 나는 해당 코드를 찾을 수 있습니다 아래의 프레스코 5.2.0 SDK 3.0.1을 사용하고 있습니다 :

<!-- /alfresco/web-extension/site-data/extensions/my-extension.xml in share-jar --> 

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


<!-- resources/components/documentlibrary/custom-documentlibrary-actions.js in share-jar 

YAHOO.Bubbling.fire("registerAction", { 
    actionName: "onActionAddToList", 
    fn: function custom_onActionAddToList(record) 
    { 
    Alfresco.util.PopupManager.displayMessage({ title: "Info", text: listManagement.insert("Hello")}); 
    } 
}); 

<!-- alfresco/module/project/context/service-context.xml in platform-jar --> 

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

<!-- java/com/test/actions/ListManagement.java in platform-jar --> 

public class ListManagement extends BaseProcessorExtension { 
    public String insert(String text) { 
    return text; 
    } 
} 

답변