Need to show help button on title bar of dashlet in alfresco - alfresco

Even if I use following line on FTL file:
new Alfresco.widget.DashletTitleBarActions("args.htmlid")
.setOptions({"actions":[{"bubbleOnClick":
{"message":'${msg("dashlet.help")}'},"cssClass":"help","tooltip":'${msg("dashlet.help.tooltip")}'}]});
It can not show help button on title bar. Please tell me how to show "help" with tool tip.

Try this may this works for you
new Alfresco.widget.DashletTitleBarActions("${id}").setOptions(
{
actions:
[
{
cssClass: "help",
bubbleOnClick:
{
message: "Information about dashlet"
},
tooltip: "Display help for this dashlet"
}
]
});
Also add <#assign id = args.htmlid?js_string> at start of your ftl or change "${id}" to "${args.htmlid}" in above code.

Related

Storybook: How to have a "select" control with options but also free text?

In storybook (React), I have set-up the following control that correctly displays iconClass as a select. I want it to provide those three "most used" options, but also give the user the ability to input a custom value. How to get this hybrid select / input text control? Thanks
argTypes: {
iconClass: {
control: {
type: 'select',
options: [
'fa-arrows-alt-v',
'fa-arrows-alt-h',
'fa-link',
]
},
}
}

How can I open "view more actions" of a document added in a new tab in the start workflow form in Alfresco?

I hope can you help me... I need open document details (View more Actions)of the documents added to a new workflow in a new tab, actually the document details open in the same tab and when i try back to the start workflow form, i have start all newly. Thank you.
P.D: Sorry for the bad English.
In the share form control named packageitems.ftl just change this piece:
<#local documentLinkResolver>
function(item) { return item.isContainer ? Alfresco.util.siteURL("folder-details?nodeRef=" + item.nodeRef, { site: item.site }) : Alfresco.util.siteURL("document-details?nodeRef=" + item.nodeRef, { site: item.site }); }
</#local>
To:
<#local documentLinkResolver>
function(item) { return item.isContainer ? Alfresco.util.siteURL("folder-details?nodeRef=" + item.nodeRef, { site: item.site }) : Alfresco.util.siteURL("document-details?nodeRef=" + item.nodeRef, { site: item.site },target="_blank"); }
</#local>
if you get an issue with the comma in the Alfresco.util.siteURL just change that to +. Or store it in a variable and add a store.
Be sure to make this your own custom packageitems control, in another folder structure and where needed add it to the share config.

Creating a button in EXTJs

I have a login screen which has an ExtJs form panel with two button Login and Reset.
Now, I'm trying to add another button below the lofin panel for a new user sign up.
But the button goes out to the bottom of the screen and a scroll bar appears making the page look ugly!
I have these in my login.jsp file:
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all-access.css">
<script type="text/javascript" src="extjs/ext-all.js"></script>
<script type="text/javascript" src="js/app.js"></script>
And this is my app.js file:
Ext.onReady(function(){
Ext.QuickTips.init();
var login = new Ext.FormPanel({
labelWidth:100,
frame:true,
title:'Member Login',
defaultType:'textfield',
monitorValid:true,
// Specific attributes for the text fields for username / password.
// The "name" attribute defines the name of variables sent to the server.
items:[{
fieldLabel:'Username',
name:'loginUsername',
allowBlank:false
},{
fieldLabel:'Password',
name:'loginPassword',
inputType:'password',
allowBlank:false
}],
buttons: [{
text: 'New User Register',
scale: 'medium',
handler: function()
{
login.getForm().doAction('standardsubmit',{
target : '_self',
method : 'POST',
standardSubmit:true,
formBind: false,
url: 'registration.jsp'
})
}
},{
text: 'Login',
scale: 'medium',
handler: function()
{
login.getForm().doAction('standardsubmit',{
target : '_self',
method : 'POST',
standardSubmit:true,
formBind: true,
url: 'index.jsp'
})
}
},{
text: 'Reset',
scale: 'medium',
handler: function(){
login.getForm().reset();
}
}]
});
// This just creates a window to wrap the login form.
// The login object is passed to the items collection.
var win = new Ext.Window({
layout:'fit',
width:325,
height:175,
closable: false,
resizable: false,
plain: true,
border: false,
items: [login]
});
win.show();
});
I tried adding a new button using the Ext.Createat the end of the above one but it wouldn't work.
I tried having the code in a separate js file and adding the script tag with src to the button file along with the panel file in a separate script tag and even that failed.
Can anybody help me out to create a separate button and my desired position?
Any kind of help is appreciated. Thanks.
I've looked everywhere and I've tried everything I could, but I'm not able to come up with the answer.
NOTE: The code makes the question seem very long and big, but my main query and issue is at the top and bottom of the question.
Im assuming you dont want to add the new button INSIDE the login panel because otherwise you could just add another button to your buttons list anyway. To add a button under your login panel and YET inside the window, do the following steps;
Put your form panel as an item inside a container
Add your button as a second item in the container after your form pannel
Add the container to your window as you did the panel to the window
Voilah! You could also try giving your window and 'id' such as 'id=loginWindow' and then calling the code
Ext.getCmp('loginWindow').add(
{
xtype:button,
text:'Yay!'
}
);
If you need more code specific help, feel free to message me. I know your feel bro <3

Is it possible to have custom Functions and commands in the TinyMCE4 Menubar?

I have learned how to integrate custom commands in the Tiny Toolbar with the
ed.addButton() Function.
Is there a similar way to add functionality to the Upper menu, the menubar ?
In the Tiny Documentation I just found how to change the order of the menu secton with this code in the init function:
menubar: "tools table format view insert edit",
Examples :
// Adds a custom menu item to the editor that inserts contents when clicked
// The context option allows you to add the menu item to an existing default menu
tinymce.init({
...
setup: function(ed) {
ed.addMenuItem('example', {
title: 'My menu item',
context: 'tools',
onclick: function() {
ed.insertContent('Hello world!!');
}
});
}
});

Sencha Touch 2 button click not working after deployment

I have a sencha touch 2 app which is working flawlessly without deployment. However, when I deploy to either testing, production or native, I have several buttons inside a navigation view with tap events which won't work anymore. No errors are shown. I cannot understand why this is happening only after deployment.
Here is the relevant code:
Controller:
control: {
'#main-function': {
tap: 'loadFunction'
},
loadMyBoat: function() {
this.getProducts().up().push({
xtype: 'myxtype',
})
Ext.getStore('Items').getProxy().setUrl('myurl');
Ext.getStore('Items').load();
},
View:
Ext.define('MyBoat.view.ItemList', {
extend: 'Ext.navigation.View',
xtype: 'myxtype',
config: {
title: 'My Title',
styleHtmlContent: true,
defaultBackButtonText: 'Items List',
items: {
xtype: 'list',
itemTpl: '{Field_Name}',
title: 'Tap on a boat to access further details',
store: 'Boats'
}
}
})
Anyone ever encountered this? Any help would be greatly appreciated.
Open up your DOM editor (in chrome, F12 I believe). Your control selector is selecting #main-function, so you'll want to make sure this is a valid selector.
On the console of your developer tools window, type:
Ext.ComponentQuery.query('#main-function')
This should be what the controller is trying.
After lots of debugging I managed to fix the problem. Turns out that using the following code to generate any component will not work well after deployment:
new Ext.button({.....})
Instead you have to use xtypes rather than the new keyword. I think this has something to do with the fact that the deployer stores all the js code in one file and thus since I was using the new keyword, it was being created somewhere in the js file when it actually won't exist in the context. The weird thing is that it does not show any errors so hopefully this will help other folks.

Resources