<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marcelo</id>
		<title>SDU - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Marcelo"/>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Special:Contributions/Marcelo"/>
		<updated>2026-07-29T16:53:48Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.1</generator>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=How_to_Script_Buttons&amp;diff=3383</id>
		<title>How to Script Buttons</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=How_to_Script_Buttons&amp;diff=3383"/>
				<updated>2008-10-16T13:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;Marcelo: /* More Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Global Header}}&lt;br /&gt;
{{Global Announcement}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Service Desk buttons are created using a ImgBtnCreate function. &lt;br /&gt;
&lt;br /&gt;
'''ImgBtnCreate(btnID, btnCaption, func, btnEnabled, btnWidth, help, tabIndex)'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:100%;vertical-align:top;&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:10%;&amp;quot; | Attribute&lt;br /&gt;
! style=&amp;quot;width:40%;&amp;quot; | Description&lt;br /&gt;
! style=&amp;quot;width:50%;&amp;quot; | Examples&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''btnID'''&lt;br /&gt;
| Used for referencing the button. This is typically a label used for easy identification of the button in scripts.&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(&amp;quot;btn001&amp;quot;, ...&lt;br /&gt;
ImgBtnCreate(&amp;quot;btnchg&amp;quot;, ...&lt;br /&gt;
ImgBtnCreate(&amp;quot;mybtn&amp;quot;, ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''btnCaption'''&lt;br /&gt;
| The text to be displayed on the button. Either identify the string such as &amp;quot;My Button&amp;quot; or reference a msgtext() value. The msgtext() value is obtained from the msg_cat.js file. &lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(..., &amp;quot;I am a button&amp;quot;...&lt;br /&gt;
ImgBtnCreate(..., msgtext(514), ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''func'''&lt;br /&gt;
| The script to be initiated when the button is selection&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(..., ..., &amp;quot;detailSave('NEW_CHANGE')&amp;quot;, ...&lt;br /&gt;
ImgBtnCreate(..., ..., &amp;quot;myscript()&amp;quot;, ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''btnEnabled'''&lt;br /&gt;
| If true then the button is Active. If false then it is not.&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(..., ..., ..., true, ...&lt;br /&gt;
ImgBtnCreate(..., ..., ..., false, ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''btnWidth''' &lt;br /&gt;
| Button width in pixels. 0 defaults to the size of the text.&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(..., ..., ..., ..., 0, ...&lt;br /&gt;
ImgBtnCreate(..., ..., ..., ..., 220, ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''help'''&lt;br /&gt;
| Displays information in status bar of the browser window. This is typically the bottom left-hand corner of your.&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(..., ..., ..., ..., ..., &amp;quot;Click here to open a ticket&amp;quot;, ...&amp;lt;/source&amp;gt;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| '''tabIndex''' &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== More Examples ==&lt;br /&gt;
'''Open a Service Desk htmpl file in a new window'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(&amp;quot;btn001&amp;quot;, &amp;quot;Custom Form&amp;quot;, &amp;quot;popup_window('','ztest.htmpl'))&amp;quot;, true, 0, &amp;quot;Select this button to view a Service Desk htmpl in a new window&amp;quot;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Open a Service Desk htmpl file in an existing window'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(&amp;quot;btn001&amp;quot;, &amp;quot;Existing Window&amp;quot;, &amp;quot;upd_frame('ztest.htmpl')&amp;quot;, true, 0, &amp;quot;Select this button to use the existing window&amp;quot;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Open a new window referencing an external URL'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(&amp;quot;btn001&amp;quot;, &amp;quot;SDU&amp;quot;, &amp;quot;popupWithURL('http://www.servicedeskusers.com', 1, 1, '')&amp;quot;, true, 0, &amp;quot;User Community for CA/Unicenter Service Desk&amp;quot;);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Open a new email message referencing the ticket'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;ImgBtnCreate(&amp;quot;btn001&amp;quot;, &amp;quot;Send eMail&amp;quot;, &amp;quot;window.open('mailto:?subject=Regarding $args.type.sym $args.ref_num&amp;amp;body=Click on the following URL to view $args.type.sym $args.ref_num: $args.web_url')&amp;quot;, true, 0);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Launch an application'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;function ExecuteMyApp() {&lt;br /&gt;
var myshell = new ActiveXObject( &amp;quot;WScript.shell&amp;quot; );&lt;br /&gt;
myshell.run( 'enter application command line here', 1, true );&lt;br /&gt;
}&lt;br /&gt;
ImgBtnCreate(&amp;quot;btn001&amp;quot;, &amp;quot;My Application&amp;quot;, &amp;quot;ExecuteMyApp()&amp;quot;, true, 0, &amp;quot;Click this button to launch My Application);&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Marcelo</name></author>	</entry>

	</feed>