====== Button ====== Button control for executing actions and controlling dialog. {{ :scripting:dialogs:button.png|Button control demo}} \\ ===== Properties ===== ^ Property ^ Default Value ^ Description ^ | **id** | empty | id (name) of the button control | | **title** | empty | title of the control. | | **admin** | false | [[wp>User_Account_Control|UAC]] icon to indicate actions requiring Administrator rights. | | **default** | false | [Indicates default button - button that is automatically executed, if user press Enter. There shall be only one //default// button on dialog for correct processing. | | **align** | stretched | [[scripting:dialogs:align|Alignment]] of the control | | **positive** | false | Indicates //positive// buttons that shall be disabled if all required fields on dialog are not filled | | **returnval** | empty | Dialog return value. If there is no //onclick// event is bound, dialog will be automatically closed, after button click and //returnval// is returned by [[scripting:api:application:dialog|Application.dialog(...)]].| ===== Events ===== ^ Event ^ Description ^ | **[[scripting:dialogs:events:onclick|onclick]]** | event handler (function name) to be called, if button is clicked| ===== Predefined Return Values ===== ^ ID ^ Positive ^ | //none// | false| | //cancel// | false| | //ok// | true| | //yes// | true| | //no// | false| | //abort// | false| | //retry// | true| | //continue// | true| | //close// | false| | //help// | false| | //other// | false| ===== Example ===== var varStorage = new Storage(); var dialog_template = '@ \ \ \ \ \ \ \ @'; Output().writeln("Dialog returns: " + dialog(dialog_template, varStorage)); function onButtonClick() { alert("Control Text: " + this.Text + "\r\nControl Name: " + this.Name); }