Artikel: AN0001717Aktualisiert: 10.11.2018
Die vorgegebene Sprachenversion vom Artikeltext wird angezeigt, weil es kein Text von der ausgewählten Sprache und Version gibt.
Object for work with toolbar in the form.
Object properties
ToolbarButton is a button in the toolbar, on which user can click and this event can be captured and processed by means of script.
HyperlinkButton is a button, which redirects user to the defined page after clicking.
Functions Create_xxx_Button create button, set a text and icon, but you have to take care of handling of the click yourself by means of a script. These functions only facilitate creation of often used buttons.
In order to handle the click you have to create a function with name ID_CLICK in the script, where ID is the id of the button that you defined at the time of its creation.
Example
Example for seting up Back to another page.
var b = OGForm.GetControl('backToolbarButton');
b.Visible = true;
b.Text = 'My Back to start';
b.NavigateUrl = 'Datas.aspx?CId=407';
Example of adding a button to the toolbar and its handling. Add this script between the script for class detail for record detail.
function OnLoad()
{
OGForm.Toolbar.CreateButton('mybutton', 'MyButton', 'images/system/new.png');
}
function mybutton_Click()
{
OGForm.SetInfo('Click on my button');
}