As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
var oButton = new YAHOO.widget.Button({ id: "copy-button", type: "button", label: "Copy", container: "someelement" }); alert("oButton===>"+oButton);
onReady() { this.widgets.copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick); …. … }, onCopyClick: Search_onCopyClick() { //copy code goes here },
<span class="yui-button yui-push-button" id="${el}-copy-button"> <span class="first-child"><button>${msg("button.copy")}</button></span> </span>
if (dataType === "document") { var viewUrl = Alfresco.constants.PROXY_URI_RELATIVE + "api/node/content/" + oRecord.getData("nodeRef").replace(":/", "") + "/" + oRecord.getData("name"); //var oButton = new YAHOO.widget.Button({ label: "Copy!", onclick: { fn: onButtonClick } }); //var copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick); //alert("viewUrl—>"+viewUrl); html = '<div class="action-overlay">' + '<a href="' + encodeURI(viewUrl) + '" target="_blank"><img title="' + $html(me.msg("label.viewinbrowser")) + '" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/view-in-browser-16.png" width="16" height="16"/></a>' + '<a href="' + encodeURI(viewUrl + "?a=true") + '" style="padding-left:4px" target="_blank"><img title="' + $html(me.msg("label.download")) + '" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/download-16.png" width="16" height="16"/></a>' + '<div id="buttoncontainer"></div>' + '</div>' + html; alert("HTML===>"+html); }
<script type="text/javascript">//<![CDATA[ new Alfresco.Search("${el}").setOptions( { siteId: "${siteId}", siteTitle: "${siteTitle?js_string}", initialSearchTerm: "${searchTerm?js_string}", initialSearchTag: "${searchTag?js_string}", initialSearchAllSites: ${searchAllSites?string}, initialSearchRepository: ${searchRepo?string}, initialSort: "${searchSort?js_string}", searchQuery: "${searchQuery?js_string}", minSearchTermLength: ${args.minSearchTermLength!searchconfig.getChildValue('min-search-term-length')}, maxSearchResults: ${args.maxSearchResults!searchconfig.getChildValue('max-search-results')} }).setMessages( ${messages} ); new YAHOO.widget.Button({ id: "copy-button", type: "button", label: "Copy", container: "buttoncontainer" }); //]]></script>
html = '<div class="action-overlay">' + '<a href="' + encodeURI(viewUrl) + '" target="_blank"><img title="' + $html(me.msg("label.viewinbrowser")) + '" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/view-in-browser-16.png" width="16" height="16"/></a>' + '<a href="' + encodeURI(viewUrl + "?a=true") + '" style="padding-left:4px" target="_blank"><img title="' + $html(me.msg("label.download")) + '" src="' + Alfresco.constants.URL_RESCONTEXT + 'components/search/images/download-16.png" width="16" height="16"/></a>' + '<span class="yui-button yui-push-button" id="copy-button">' + '<span class="first-child"><button>Copia</button></span> ' + '</span>' + '</div>' + html; alert("HTML===>"+html);
//Copy YUI button this.widgets.copyButton = Alfresco.util.createYUIButton(this, "copy-button", this.onCopyClick);
onCopyClick: function Search_onCopyClick() { alert("HELLO"); },
renderCellCopy = function Search_renderCellCopy(elCell, oRecord, oColumn, oData) { Dom.setStyle(elCell.parentNode, "width", oColumn.width + "px"); Dom.setStyle(elCell, "height", oColumn.height + "px"); Dom.addClass(elCell, "copy-cell"); html = ' <span id="pushbutton" class="yui-button"><button type="button">Copy</button></span>'; //html = '<div id="bcontainer"> </div>'; elCell.innerHTML = html; YAHOO.util.Event.addListener("pushbutton", "click", this.onCopyClick,this); };
onCopyClick: function Search_onCopyClick(obj) { alert("HELLO"); },
(function() { Alfresco.doclib.Actions.prototype.onActionLinkTo = function dlA_onActionLinkTo(record, owner) { // Get action & params and start create the config for displayForm var action = this.getAction(record, owner), params = action.params, config = { title: this.msg(action.label) }, displayName = record.displayName; // Make sure we don't pass the function as a form parameter delete params["function"]; if (!this.modules.linkTo) { this.modules.linkTo = new Alfresco.module.DoclibGlobalFolder(this.id + "-linkTo"); } this.modules.linkTo.setOptions( { allowedViewModes: [ Alfresco.module.DoclibGlobalFolder.VIEW_MODE_SITE, Alfresco.module.DoclibGlobalFolder.VIEW_MODE_REPOSITORY, Alfresco.module.DoclibGlobalFolder.VIEW_MODE_USERHOME ], title: "Link " + record.fileName + " to…", siteId: this.options.siteId, containerId: this.options.containerId, path: this.currentPath, files: record, rootNode: this.options.rootNode, parentId: this.getParentNodeRef(record) }).showDialog(); YAHOO.Bubbling.on("folderSelected", this.onFolderSelected, this.modules.linkTo); }; Alfresco.doclib.Actions.prototype.onFolderSelected = function linkFolder_onFolderSelected(event, args) { Alfresco.logger.info("— event : " + event); } })();
new YAHOO.widget.Button
var buttonsArray = YAHOO.util.Selector('.copy-button')
… var buttonEl = document.createElement('button'); buttonEl.setAttribute('id', 'something_unique_here_ie_from_oRecord'); .. // now make this a button or something: var myButton = new YAHOO.widget.Button(buttonEl, buttonConfigObject); … // then attach it to child element elCell.appendChild(buttonEl);