How to Script Buttons

From SDU
Revision as of 06:04, 31 March 2008 by Jigna (Talk | contribs)

Jump to: navigation, search

Service Desk buttons are created using a ImgBtnCreate function.

ImgBtnCreate(btnID, btnCaption, func, btnEnabled, btnWidth, help, tabIndex)


Attribute Description Examples
btnID Used for referencing the button. This is typically a label used for easy identification of the button in scripts. <source lang="javascript">ImgBtnCreate("btn001", ...

ImgBtnCreate("btnchg", ... ImgBtnCreate("mybtn", ...</source>

btnCaption The text to be displayed on the button. Either identify the string such as "My Button" or reference a msgtext() value. The msgtext() value is obtained from the msg_cat.js file. <source lang="javascript">ImgBtnCreate(..., "I am a button"...

ImgBtnCreate(..., msgtext(514), ...</source>

func The script to be initiated when the button is selection <source lang="javascript">ImgBtnCreate(..., ..., "detailSave('NEW_CHANGE')", ...

ImgBtnCreate(..., ..., "myscript()", ...</source>

btnEnabled If true then the button is Active. If false then it is not. <source lang="javascript">ImgBtnCreate(..., ..., ..., true, ...

ImgBtnCreate(..., ..., ..., false, ...</source>

btnWidth Button width in pixels. 0 defaults to the size of the text. <source lang="javascript">ImgBtnCreate(..., ..., ..., ..., 0, ...

ImgBtnCreate(..., ..., ..., ..., 220, ...</source>

help Displays information in status bar of the browser window. This is typically the bottom left-hand corner of your. <source lang="javascript">ImgBtnCreate(..., ..., ..., ..., ..., "Click here to open a ticket", ...</source>
tabIndex


More Examples

Open a Service Desk htmpl file in a new window <source lang="javascript">ImgBtnCreate("btn001", "Custom Form", "popup_window(,'ztest.htmpl'))", true, 0, "Select this button to view a Service Desk htmpl in a new window");</source>


Open a Service Desk htmpl file in an existing window <source lang="javascript">ImgBtnCreate("btn001", "Existing Window", "upd_frame('ztest.htmpl')", true, 0, "Select this button to use the existing window");</source>


Open a new window referencing an external URL <source lang="javascript">ImgBtnCreate("btn001", "SDU", "popWithURL('http://www.servicedeskusers.com', 1, )", true, 0, "User Community for CA/Unicenter Service Desk");</source>


Open a new email message referencing the ticket <source lang="javascript">ImgBtnCreate("btn001", "Send eMail", "window.open('mailto:?subject=Regarding $args.type.sym $args.ref_num&body=Click on the following URL to view $args.type.sym $args.ref_num: $args.web_url')", true, 0);</source>



To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.


USD r11.2 – Add a Date, Lookup, Text area, Check box, drop-down and Readonly controls under Property value field (WEB Interface ONLY)