我在文档库中配置了新的多选择按钮:

单击按钮时,它应该执行javascript函数onActionAddToList,该函数稍后调用bean函数insert。除了bean函数之外,一切都正常工作--它不被调用/识别。我做错了什么吗?我想知道是否应该在另一个地方配置bean?我正在使用ALFERCO5.2.0SDK 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;
}
}发布于 2017-12-08 08:15:48
请引用此问题,并引用此文档调用javabacked。
https://stackoverflow.com/questions/47695599
复制相似问题