Alfresco - 分类选择器

时间:2015-07-15 13:56:53

标签: categories alfresco-share

我想使用JavaScript Alfresco.ObjectPicker组件将类别选择器放入文件中:dnd-upload.get.html.ftl

<div class="form-field inlineable">
  <label >Catégories:</label>                             
    <div class="object-finder inlineable" id="a_default_prop_cm_categories-cntrl">                                       
        <div class="current-values inlineable object-finder-items" id="b_default_prop_cm_categories-cntrl-currentValueDisplay"></div>                                        
        <input type="hidden" value="" name="prop_cm_categories" id="c_default_prop_cm_categories"/>
        <div class="show-picker inlineable" id="d_default_prop_cm_categories-cntrl-itemGroupActions"><span class="yui-button yui-push-button" id="yui-gen7"><span class="first-child"><button type="button" tabindex="0" id="yui-gen7-button" >Sélectionner</button></span></span></div>                                    
        <script type="text/javascript"> //<![CDATA[
        (function(){
                    var picker = new Alfresco.ObjectFinder("a_default_prop_cm_categories-cntrl", "c_default_prop_cm_categories").setOptions(
                   {                                                          
                      field: "prop_cm_categories",
                      compactMode: true,
                      mandatory: false,
                      currentValue: "",                                                                                                              
                      selectActionLabel: "Sélectionner",
                      minSearchTermLength: 1,
                      maxSearchResults: 1000
                   }).setMessages(
                      {""}
                   );
                   picker.setOptions(
                   {
                      itemType: "cm:category",
                      multipleSelectMode: true,
                      parentNodeRef: "alfresco://category/root",
                      itemFamily: "category",
                      maintainAddedRemovedItems: false,
                      params: "",
                      createNewItemUri: "",
                      createNewItemIcon: ""
                   }); 
        })();
        //]]>
        </script>                                   
    </div>
</div>

我在同一个文件中声明了一个JS依赖项:dnd-upload.get.html.ftl

<@script type="text/javascript" src="${url.context}/res/components/object-finder/object-finder.js" group="objectfinder"/>

当我点击按钮:“Sélectionner”时,没有任何反应,我也没有控制台错误。

您是否,请知道如何使此Picker工作?

此致 索菲亚。

0 个答案:

没有答案