12-29-2013 06:20 AM
<#– Custom Select Value BUTTON –>
<@markup id="categoryButton">
<#if uploadable>
<div class="hideable toolbar-hidden DocListTree">
<div class="category-select">
<span id="${id}-categorySelect-button" class="yui-button yui-push-button">
<span class="first-child">
<button name="fileUpload">Select Category..</button>
</span>
</span>
</div>
</div>
</#if>
</@>
// Custom button to select category
this.widgets.selectCategory = Alfresco.util.createYUIButton(this, "categorySelect-button", this.onCategorySelect,
{
disabled: true,
title: "Select Category .."
});
this.dynamicControls.push(this.widgets.selectCategory);
onCategorySelect: function DTLB_onCategorySelect(e, p_obj){
alert("—-> onCategorySelect Function Called <—- ");
var categorySelect = new Alfresco.module.SimpleDialog(this.id + "-categorySelect");
categorySelect.setOptions({
width : "30em",
templateUrl : Alfresco.constants.URL_PAGECONTEXT+ "modules/documentlibrary/select-category",
destroyOnHide: true,
onSuccess:
{
fn: function dlA_onActionEditTag_success(response)
{
Alfresco.util.PopupManager.displayMessage({
text: "Success"
});
},
scope: this
},
onFailure:
{
fn: function onActionEditTag_failure(response)
{
Alfresco.util.PopupManager.displayMessage({
text: "Failed"
});
},
scope: this
}
}).show();
},
<webscript>
<shortname>select-category</shortname>
<description>Dialog to select category</description>
<url>/modules/documentlibrary/select-category</url>
</webscript>
<@markup id="js">
<#– JavaScript Dependencies –>
<@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/selectCategory.js" group="documentlibrary" />
</@>
<@markup id="html">
<@uniqueIdDiv>
<#assign el=args.htmlid?html>
<div id="${el}-dialog" class="create-folder">
<div id="${el}-dialogTitle" class="hd">${msg("title")}</div>
<div class="bd">
<form id="${el}-form" action="" method="post">
<div class="yui-g">
<h2 id="${el}-dialogHeader">${msg("header")}</h2>
</div>
<div class="bdft">
<input type="button" id="${el}-ok" value="${msg("button.ok")}" tabindex="0" />
<input type="button" id="${el}-cancel" value="${msg("button.cancel")}" tabindex="0" />
</div>
</form>
</div>
</div>
</@>
</@>
/**
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Select Category .
*
* @namespace Alfresco
* @class Alfresco.SelectCategory
*/
(function() {
/**
* YUI Library aliases
*/
var Dom = YAHOO.util.Dom, Event = YAHOO.util.Event, Bubbling = YAHOO.Bubbling;
/**
* Alfresco Slingshot aliases
*/
var $html = Alfresco.util.encodeHTML, $hasEventInterest = Alfresco.util.hasEventInterest, $combine = Alfresco.util.combinePaths;
/**
* SelectCategory constructor.
*
* @param htmlId
* {String} The HTML id of the parent element
* @return {Alfresco.SelectCategory} The new SelectCategory instance
* @constructor
*/
Alfresco.SelectCategory = function(htmlId) {
Alfresco.SelectCategory.superclass.constructor.call(this,
"Alfresco.SelectCategory", htmlId, [ "button", "container" ]);
this.eventGroup = htmlId;
return this;
};
YAHOO.extend(Alfresco.SelectCategory, Alfresco.component.Base, {
/**
* Fired by YUI when parent element is available for scripting
*
* @method onReady
*/
onReady : function SelectCategory_onReady() {
alert(" —-> onReady called <—- ");
}
});
})();
01-03-2014 01:07 PM
05-28-2015 02:37 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.