Custom button in header (process)

Contains tips for configurators working with Aware IM
Post Reply
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Custom button in header (process)

Post by hpl123 »

Hi all,
This is a tip on how to create a custom button in a form or query header that starts a process.

There are 2 options:

Option 1, extjs icon button:
Add the script below to the advanced script settings and you can choose a extjs icon that starts a process (You can also set e.g tooltip etc. In the example below, the help icon is used.):
"config.tools.push ({ type: 'help',tooltip: 'Tooltip' handler:function () { AwareApp.startProcess('MyProcess') }});"

Option 2, button:
Add the script below to the advanced script settings and you add a button that starts a process (You can also set e.g button text, tooltip etc. and I imagine it´s also possible to set an image in the button and If any of you do this, please share how you did it.):
"config.tools.push ({ xtype: 'button',text:'Text',tooltip:'Tooltip', handler:function () { AwareApp.startProcess('MyProcess') }})"
Henrik (V8 Developer Ed. - Windows)
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Form issues

Post by hpl123 »

There are some issues using the script above in forms. I have together with Awaresoft support managed to figure out why this happens and the solution is 2 sided. 1, there is a fix coming up in an upcoming version and 2, use another script in forms (see below):

if(!config.tools)config.tools=new Array(); config.tools.push ({ type: "help",tooltip: "MyTooltip", handler:function () { AwareApp.startProcess("MyProcess") }});

PS: The solution in this post is for the extjs icon option but I think the same solution works for the button option.
Henrik (V8 Developer Ed. - Windows)
Post Reply