{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:id=|class=servoy sSummery}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summery{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#text]
{td}{tr}{tbody}{table}\\
{table:id=|class=servoy sSummery}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summery{th}{tr}{tbody}{tr}{td}[CheckBox]{td}{td}[#addCheckBox]\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#addMenu]\(\[name\], \[menu\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the submenu at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#addMenuItem]\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the item at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#addRadioButton]\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\])
Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addRadioGroup]\()
Add a Radiogroup for the Radiobuttons.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#addSeparator]\()
Add the separator at the selected index (starting at 0) or add it at the end (empty).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#doClick]\(click)
Script the selection (emulate a mouse click) of the menu.{td}{tr}{tbody}{tbody}{tr}{td}[CheckBox]{td}{td}[#getCheckBox]\(index)
Get the Checkbox at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[MenuItem]{td}{td}[#getItem]\(index)
Get the item at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getItemCount]\()
Get the number of items in the menu.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getItemIndexByText]\(name)
Retrieve the index of the item by text.{td}{tr}{tbody}{tbody}{tr}{td}[Menu]{td}{td}[#getMenu]\(index)
Get the submenu at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}[RadioButton]{td}{td}[#getRadioButton]\(index)
Get the Radiobutton at the selected index (starting at 0).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeAllItems]\()
Remove all items from the menu.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#removeItem]\(index 1, \[index 2-n\])
Remove the item(s) at the selected index/indices.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setEnabled]\(enabled)
Set the the selected menu enabled or disabled.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setIcon]\(icon)
Set the icon of the menu.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#setMnemonic]\(mnemonic)
Set the mnemonic of the selected menu.{td}{tr}{tbody}{table}\\
{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=text|class=node}{tr:id=name}{td}h6.text{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:text_des|text=|trigger=button}{sub-section}{sub-section:text_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:text_snc|text=|trigger=button}{sub-section}{sub-section:text_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:text_prs|text=|trigger=button}{sub-section}{sub-section:text_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:text_ret|text=|trigger=button}{sub-section}{sub-section:text_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:text_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:text_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:text_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:text_sam|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=addCheckBox|class=node}{tr:id=name}{td}h6.addCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}addCheckBox{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addCheckBox_des|text=|trigger=button}{sub-section}{sub-section:addCheckBox_des|trigger=none|class=sIndent}Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addCheckBox_snc|text=|trigger=button}{sub-section}{sub-section:addCheckBox_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addCheckBox_prs|text=|trigger=button}{sub-section}{sub-section:addCheckBox_prs|trigger=none|class=sIndent}\[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addCheckBox_ret|text=|trigger=button}{sub-section}{sub-section:addCheckBox_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addCheckBox_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addCheckBox_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addCheckBox_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addCheckBox_sam|trigger=none}{code:language=javascript}
// Add the Checkbox at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// when you don't define an index the checkbox will be added at the last position
// this is what you usually do to build a new menu
// minimum settings are the text and method properties
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
var checkbox = menu.addCheckBox("checkbox with feedback",feedback_checkbox);
var checkbox = menu.addCheckBox("checkbox selected",feedback_checkbox);
// set the checkbox to selected
checkbox.setSelected(true);
var checkbox = menu.addCheckBox("checkbox with input");
// add an 'input' array. the array will be concatenated to the end of the arguments
// array which can be read out in the selected method
var input = [1,"is","the","added","input",false];
checkbox.setMethod(feedback_checkbox, input);
// create a checkbox with an icon
var checkbox = menu.addCheckBox("checkbox with icon",feedback_checkbox,"media:///yourimage.gif");
var checkbox = menu.addCheckBox("checkbox with accelerator",feedback_checkbox,"media:///yourimage.gif");
// add an accelerator key ('alt shift a' in the below example)
// REMARK: always test the accelerator key. sometimes they will not work because
// these keys already have an 'action' assigned to them via the operating system.
checkbox.setAccelerator("alt shift a");
var checkbox = menu.addCheckBox("checkbox with mnemonic",feedback_checkbox,false,input,"media:///yourimage.gif");
// add a mnemonic key ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
checkbox.setMnemonic("i");
var checkbox = menu.addCheckBox("checkbox disabled",feedback_checkbox);
// disable the menu item
checkbox.setEnabled(false);
var checkbox = menu.addCheckBox("checkbox invisible",feedback_checkbox);
// set the menu item disabled and NOT visible
checkbox.setVisible(false);
// add a separator at the last position or at a given index
menu.addSeparator();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenu|class=node}{tr:id=name}{td}h6.addMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenu{span}{span:id=iets|style=float: left;}\(\[name\], \[menu\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenu_des|text=|trigger=button}{sub-section}{sub-section:addMenu_des|trigger=none|class=sIndent}Add the submenu at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenu_snc|text=|trigger=button}{sub-section}{sub-section:addMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenu_prs|text=|trigger=button}{sub-section}{sub-section:addMenu_prs|trigger=none|class=sIndent}\[name\]
\[menu\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenu_ret|text=|trigger=button}{sub-section}{sub-section:addMenu_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenu_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenu_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenu_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenu_sam|trigger=none}{code:language=javascript}
// Add the submenu at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// add a (first) submenu
var submenu1 = menu.addMenu("submenu 1");
submenu1.addMenuItem("sub item 1",globals.feedback_item);
// add a (second) submenu
var submenu2 = submenu1.addMenu("submenu 2");
submenu2.addMenuItem("sub item 2",globals.feedback_item);
// add a (third) submenu
var submenu3 = submenu1.addMenu("submenu 3");
submenu3.addMenuItem("sub item 3",globals.feedback_item);
// add a (first) submenu to the (third) submenu
var submenu4 = submenu3.addMenu("submenu 4");
submenu4.addMenuItem("sub item 4",globals.feedback_item);
// add a (first) submenu to the (first) submenu of the (third) submenu
var submenu5 = submenu4.addMenu("submenu 5");
submenu5.addMenuItem("sub item 5",globals.feedback_item);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addMenuItem|class=node}{tr:id=name}{td}h6.addMenuItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}addMenuItem{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addMenuItem_des|text=|trigger=button}{sub-section}{sub-section:addMenuItem_des|trigger=none|class=sIndent}Add the item at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addMenuItem_snc|text=|trigger=button}{sub-section}{sub-section:addMenuItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addMenuItem_prs|text=|trigger=button}{sub-section}{sub-section:addMenuItem_prs|trigger=none|class=sIndent}\[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addMenuItem_ret|text=|trigger=button}{sub-section}{sub-section:addMenuItem_ret|trigger=none|class=sIndent}[MenuItem]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addMenuItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addMenuItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addMenuItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addMenuItem_sam|trigger=none}{code:language=javascript}
// Add the item at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// when you don't define an index the item will be added at the last position
// this is what you usually do to build a new menu
// create the settings for the specified menu item
// minimum settings are the text and method properties
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
var item = menu.addMenuItem("item with feedback",globals.feedback_item);
var item = menu.addMenuItem();
// add an 'input' array. the array will be concatenated to the end of the arguments
// array which can be read out in the selected method
var input = [1,"is","the","added","input",false];
item.text = "item with input";
item.setMethod(globals.feedback_item,input);
var item = menu.addMenuItem();
// add an icon to the item
item.text = "item with icon";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");
var item = menu.addMenuItem();
// add an accelerator key ('alt shift 2' in the below example)
// REMARK: always test the accelerator key. sometimes they will not work because
// these keys already have an 'action' assigned to them via the operating system.
item.text = "item with accelerator";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");
item.setAccelerator("alt shift 2");
var item = menu.addMenuItem();
// add a mnemonic key ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
// the accelerator key will not work in this and the next example
item.text = "item with mnemonic";
item.setMethod(globals.feedback_item, input);
item.setIcon("media:///yourimage.gif");
item.setAccelerator("pressed COMMA");
item.setMnemonic("i");
// create a disabled menu item
var item = menu.addMenuItem("item disabled",globals.feedback_item,"media:///yourimage.gif","t",false);
// set the method args
item.setMethodArguments(input);
var item = menu.addMenuItem("item visible",globals.feedback_item,"media:///yourimage.gif","e");
// this accelerator key will work
item.setAccelerator("shift meta PAGE_DOWN");
var item = menu.addMenuItem("item invisible",globals.feedback_item,"media:///yourimage.gif");
// now the item is enabled and NOT visible
item.setVisible(false);
// add a separator at the last position or at a given index
menu.addSeparator();
return;
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioButton|class=node}{tr:id=name}{td}h6.addRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioButton{span}{span:id=iets|style=float: left;}\(\[name\], \[method\], \[icon\], \[mnemonic\], \[enabled\], \[align\]){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioButton_des|text=|trigger=button}{sub-section}{sub-section:addRadioButton_des|trigger=none|class=sIndent}Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioButton_snc|text=|trigger=button}{sub-section}{sub-section:addRadioButton_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioButton_prs|text=|trigger=button}{sub-section}{sub-section:addRadioButton_prs|trigger=none|class=sIndent}\[name\]
\[method\]
\[icon\]
\[mnemonic\]
\[enabled\]
\[align\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioButton_ret|text=|trigger=button}{sub-section}{sub-section:addRadioButton_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioButton_sam|trigger=none}{code:language=javascript}
// Add the Radiobutton at the selected index (starting at 0) or add it at the end (empty).
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// add a new Radiobutton group
// a group will 'bind' all added radiobuttons after the group together
// as a result checking one item will uncheck the other
menu.addRadioGroup();
// when you don't define an index the radiobutton will be added at the last position
// this is what you usually do to build a new menu
// create the settings for the specified menu item
// minimum settings are the text and method properties
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
var radiobutton = menu.addRadioButton("radiobutton with feedback",feedback_radiobutton);
var radiobutton = menu.addRadioButton("radiobutton selected",feedback_radiobutton);
// set the radiobutton to selected
radiobutton.setSelected(true);
var radiobutton = menu.addRadioButton("radiobutton with input");
// add an 'input' array. the array will be concatenated to the end of the arguments
// array which can be read out in the selected method
var input = [1,"is","the","added","input",false];
radiobutton.setMethod(feedback_radiobutton,input);
// create an item with an icon
var radiobutton = menu.addRadioButton("radiobutton with icon",feedback_radiobutton,"media:///yourimage.gif");
var radiobutton = menu.addRadioButton("radiobutton with accelerator",feedback_radiobutton);
// add an accelerator key ('alt shift 3' in the below example)
// REMARK: always test the accelerator key. sometimes they will not work because
// these keys already have an 'action' assigned to them via the operating system.
radiobutton.setAccelerator("alt shift 3");
// add a separator at the last position or at a given index
menu.addSeparator();
// add a new Radiobutton group
menu.addRadioGroup();
// add a mnemonic key ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
var radiobutton = menu.addRadioButton("radiobutton with mnemonic",feedback_radiobutton,"media:///yourimage.gif","i");
var radiobutton = menu.addRadioButton("radiobutton disabled",feedback_radiobutton);
// disable the menu item
radiobutton.setEnabled(false);
var radiobutton = menu.addRadioButton("radiobutton invisible",feedback_radiobutton);
// now the item is enabled and NOT visible
radiobutton.setVisible(false);
// add a separator at the last position or at a given index
menu.addSeparator();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addRadioGroup|class=node}{tr:id=name}{td}h6.addRadioGroup{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addRadioGroup{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addRadioGroup_des|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_des|trigger=none|class=sIndent}Add a Radiogroup for the Radiobuttons.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addRadioGroup_snc|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addRadioGroup_prs|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addRadioGroup_ret|text=|trigger=button}{sub-section}{sub-section:addRadioGroup_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addRadioGroup_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addRadioGroup_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addRadioGroup_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addRadioGroup_sam|trigger=none}{code:language=javascript}
// Add a Radiogroup for the Radiobuttons.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// add a new Radiobutton group
// a group will 'bind' all added radiobuttons after the group together
// as a result checking one item will uncheck the other
menu.addRadioGroup();
// when you don't define an index the radiobutton will be added at the last position
// this is what you usually do to build a new menu
// create the settings for the specified menu item
// minimum settings are the text and method properties
// the method can be a global or form method
// be sure to enter the method WITHOUT '()' at the end
var radiobutton = menu.addRadioButton("radiobutton with feedback",feedback_radiobutton);
var radiobutton = menu.addRadioButton("radiobutton selected",feedback_radiobutton);
// set the radiobutton to selected
radiobutton.setSelected(true);
var radiobutton = menu.addRadioButton("radiobutton with input");
// add an 'input' array. the array will be concatenated to the end of the arguments
// array which can be read out in the selected method
var input = [1,"is","the","added","input",false];
radiobutton.setMethod(feedback_radiobutton,input);
// create an item with an icon
var radiobutton = menu.addRadioButton("radiobutton with icon",feedback_radiobutton,"media:///yourimage.gif");
var radiobutton = menu.addRadioButton("radiobutton with accelerator",feedback_radiobutton);
// add an accelerator key ('alt shift 3' in the below example)
// REMARK: always test the accelerator key. sometimes they will not work because
// these keys already have an 'action' assigned to them via the operating system.
radiobutton.setAccelerator("alt shift 3");
// add a separator at the last position or at a given index
menu.addSeparator();
// add a new Radiobutton group
menu.addRadioGroup();
// add a mnemonic key ('i' in our example) which is the underlined shortkey on windows
// REMARK: setting the mnemonic key is platform dependent
var radiobutton = menu.addRadioButton("radiobutton with mnemonic",feedback_radiobutton,"media:///yourimage.gif","i");
var radiobutton = menu.addRadioButton("radiobutton disabled",feedback_radiobutton);
// disable the menu item
radiobutton.setEnabled(false);
var radiobutton = menu.addRadioButton("radiobutton invisible",feedback_radiobutton);
// now the item is enabled and NOT visible
radiobutton.setVisible(false);
// add a separator at the last position or at a given index
menu.addSeparator();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=addSeparator|class=node}{tr:id=name}{td}h6.addSeparator{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}addSeparator{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:addSeparator_des|text=|trigger=button}{sub-section}{sub-section:addSeparator_des|trigger=none|class=sIndent}Add the separator at the selected index (starting at 0) or add it at the end (empty).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:addSeparator_snc|text=|trigger=button}{sub-section}{sub-section:addSeparator_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:addSeparator_prs|text=|trigger=button}{sub-section}{sub-section:addSeparator_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:addSeparator_ret|text=|trigger=button}{sub-section}{sub-section:addSeparator_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:addSeparator_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:addSeparator_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:addSeparator_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:addSeparator_sam|trigger=none}{code:language=javascript}
// Add the separator at the selected index (starting at 0) or add it at the end (empty).
plugins.window.getMenu(0).addSeparator();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=doClick|class=node}{tr:id=name}{td}h6.doClick{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}doClick{span}{span:id=iets|style=float: left;}\(click){span}{td}{tr}{tr:id=des}{td}{sub-section:doClick_des|text=|trigger=button}{sub-section}{sub-section:doClick_des|trigger=none|class=sIndent}Script the selection (emulate a mouse click) of the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:doClick_snc|text=|trigger=button}{sub-section}{sub-section:doClick_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:doClick_prs|text=|trigger=button}{sub-section}{sub-section:doClick_prs|trigger=none|class=sIndent}click
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:doClick_ret|text=|trigger=button}{sub-section}{sub-section:doClick_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:doClick_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:doClick_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:doClick_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:doClick_sam|trigger=none}{code:language=javascript}
// Script the selection (emulate a mouse click) of the menu.
plugins.window.getMenu(0).doClick();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCheckBox|class=node}{tr:id=name}{td}h6.getCheckBox{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[CheckBox]{span}{span:id=iets|style=float: left; font-weight: bold;}getCheckBox{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getCheckBox_des|text=|trigger=button}{sub-section}{sub-section:getCheckBox_des|trigger=none|class=sIndent}Get the Checkbox at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getCheckBox_snc|text=|trigger=button}{sub-section}{sub-section:getCheckBox_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getCheckBox_prs|text=|trigger=button}{sub-section}{sub-section:getCheckBox_prs|trigger=none|class=sIndent}index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getCheckBox_ret|text=|trigger=button}{sub-section}{sub-section:getCheckBox_ret|trigger=none|class=sIndent}[CheckBox]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getCheckBox_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getCheckBox_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getCheckBox_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCheckBox_sam|trigger=none}{code:language=javascript}
// Get the Checkbox at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
var checkbox = menu.getCheckBox(0);
checkbox.setText("Changed menu item");
// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:
// get the menu
// var menu = plugins.window.getMenu(2);
// get the item
// var item = menu.getItem(0);
// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItem|class=node}{tr:id=name}{td}h6.getItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MenuItem]{span}{span:id=iets|style=float: left; font-weight: bold;}getItem{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getItem_des|text=|trigger=button}{sub-section}{sub-section:getItem_des|trigger=none|class=sIndent}Get the item at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItem_snc|text=|trigger=button}{sub-section}{sub-section:getItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getItem_prs|text=|trigger=button}{sub-section}{sub-section:getItem_prs|trigger=none|class=sIndent}index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getItem_ret|text=|trigger=button}{sub-section}{sub-section:getItem_ret|trigger=none|class=sIndent}[MenuItem]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItem_sam|trigger=none}{code:language=javascript}
// Get the item at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
var item = menu.getItem(0);
item.setText("Changed menu item");
// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:
// get the menu
// var menu = plugins.window.getMenu(2);
// get the item
// var item = menu.getItem(0);
// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItemCount|class=node}{tr:id=name}{td}h6.getItemCount{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getItemCount{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getItemCount_des|text=|trigger=button}{sub-section}{sub-section:getItemCount_des|trigger=none|class=sIndent}Get the number of items in the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItemCount_snc|text=|trigger=button}{sub-section}{sub-section:getItemCount_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getItemCount_prs|text=|trigger=button}{sub-section}{sub-section:getItemCount_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getItemCount_ret|text=|trigger=button}{sub-section}{sub-section:getItemCount_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItemCount_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItemCount_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItemCount_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemCount_sam|trigger=none}{code:language=javascript}
// Get the number of items in the menu.
// REMARK: indexes start at 0, disabled items, non visible items and seperators are counted also
// REMARK: this is especially important when getting items by the index
application.output(plugins.window.getMenu(0).getItemCount());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getItemIndexByText|class=node}{tr:id=name}{td}h6.getItemIndexByText{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getItemIndexByText{span}{span:id=iets|style=float: left;}\(name){span}{td}{tr}{tr:id=des}{td}{sub-section:getItemIndexByText_des|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_des|trigger=none|class=sIndent}Retrieve the index of the item by text.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getItemIndexByText_snc|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getItemIndexByText_prs|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_prs|trigger=none|class=sIndent}name
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getItemIndexByText_ret|text=|trigger=button}{sub-section}{sub-section:getItemIndexByText_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getItemIndexByText_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getItemIndexByText_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getItemIndexByText_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getItemIndexByText_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}
{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMenu|class=node}{tr:id=name}{td}h6.getMenu{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Menu]{span}{span:id=iets|style=float: left; font-weight: bold;}getMenu{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getMenu_des|text=|trigger=button}{sub-section}{sub-section:getMenu_des|trigger=none|class=sIndent}Get the submenu at the selected index (starting at 0).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getMenu_snc|text=|trigger=button}{sub-section}{sub-section:getMenu_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getMenu_prs|text=|trigger=button}{sub-section}{sub-section:getMenu_prs|trigger=none|class=sIndent}index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getMenu_ret|text=|trigger=button}{sub-section}{sub-section:getMenu_ret|trigger=none|class=sIndent}[Menu]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getMenu_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getMenu_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getMenu_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getMenu_sam|trigger=none}{code:language=javascript}
// Get the submenu at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
var checkbox = menu.getMenu(0);
checkbox.setText("Changed menu item");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRadioButton|class=node}{tr:id=name}{td}h6.getRadioButton{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[RadioButton]{span}{span:id=iets|style=float: left; font-weight: bold;}getRadioButton{span}{span:id=iets|style=float: left;}\(index){span}{td}{tr}{tr:id=des}{td}{sub-section:getRadioButton_des|text=|trigger=button}{sub-section}{sub-section:getRadioButton_des|trigger=none|class=sIndent}Get the Radiobutton
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Property SummaryRetrieve/set the text.servoy sSummary12%30%58%height: 30px;3Methods SummaryAdd a checkbox.Add a checkbox at the selected index (starting at 0) or at the end.Add a checkbox with given name.Add a checkbox at the selected index (starting at 0) or at the end.Add a checkbox at the selected index (starting at 0) or at the end.Add a checkbox at the selected index (starting at 0) or at the end.Add a checkbox at the selected index (starting at 0) or at the end.Add a checkbox at the selected index (starting at 0) or at the end.Add a submenu at the end.Add a submenu at the selected index (starting at 0).Add a submenu with given name.Add a menu item.Add a menu item at the selected index (starting at 0) or at the end.Add a menu item with given name.Add a menu item at the selected index (starting at 0) or at the end.Add a menu item at the selected index (starting at 0) or at the end.Add a menu item at the selected index (starting at 0) or at the end.Add a menu item at the selected index (starting at 0) or at the end.Add a menu item at the selected index (starting at 0) or at the end.Add a radio button.Add a radiobutton at the selected index (starting at 0) or at the end.Add a radio button with given name.Add a radiobutton at the selected index (starting at 0) or at the end.Add a radiobutton at the selected index (starting at 0) or at the end.Add a radiobutton at the selected index (starting at 0) or at the end.Add a radiobutton at the selected index (starting at 0) or at the end.Add a radiobutton at the selected index (starting at 0) or at the end.voidAdd a radiogroup for radiobuttons.voidAdd the separator at the selected index (starting at 0) or at the end (empty).voidAdd the separator at the selected index (starting at 0) or at the end (empty).voidScript the selection (emulate a mouse click) of the menu.Get the checkbox at the selected index (starting at 0).Gets the specified client property for the element based on a key.Get the item at the selected index (starting at 0).Get the number of items in the menu.Retrieve the index of the item by text.Get the submenu at the selected index (starting at 0).Get the radiobutton at the selected index (starting at 0).voidSets the value for the specified element client property key.voidRemove all items from the menu.voidRemove the item(s) at the selected index/indices.voidSet the the selected menu enabled or disabled.voidSet the icon of the menu.voidSet the mnemonic of the selected menu.propertyservoy sDetail2100%height:30px2Property Detailstextname
Add a checkbox at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentindexthe index at which to add the checkboxret
Returns
sIndent checkboxclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddCheckBoxname
addCheckBox(name)
dessIndent
Add a checkbox with given name.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsret
Returns
sIndent checkboxclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddCheckBoxname
addCheckBox(name, feedback_item)
dessIndent
Add a checkbox at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functionret
Returns
sIndent checkboxclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddCheckBoxname
addCheckBox(name, feedback_item, icon)
dessIndent
Add a checkbox at the selected index (starting at 0)
.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRadioButton_snc|text=|trigger=button}{sub-section}{sub-section:getRadioButton_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:getRadioButton_prs|text=|trigger=button}{sub-section}{sub-section:getRadioButton_prs|trigger=none|class=sIndent}index
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:getRadioButton_ret|text=|trigger=button}{sub-section}{sub-section:getRadioButton_ret|trigger=none|class=sIndent}[RadioButton]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRadioButton_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRadioButton_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRadioButton_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRadioButton_sam|trigger=none}{code:language=javascript}
// Get the Radiobutton at the selected index (starting at 0).
// get the menu at the last position
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
var checkbox = menu.getItem(0);
checkbox.setText("Changed menu item");
// REMARK: we actually changed an original menu (item)! As a result resetting the
// menubar will NOT reset the above changes. We need to reset the menu (item)
// manually the following way:
// get the menu
// var menu = plugins.window.getMenu(2);
// get the item
// var item = menu.getItem(0);
// reset the values to default
// notice we use an i18n message here the same way you would use it with
// standard Servoy methods and plugins
// item.setText("i18n:servoy.menuitem.viewAsRecord");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeAllItems|class=node}{tr:id=name}{td}h6.removeAllItems{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeAllItems{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:removeAllItems_des|text=|trigger=button}{sub-section}{sub-section:removeAllItems_des|trigger=none|class=sIndent}Remove all items from the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeAllItems_snc|text=|trigger=button}{sub-section}{sub-section:removeAllItems_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:removeAllItems_prs|text=|trigger=button}{sub-section}{sub-section:removeAllItems_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:removeAllItems_ret|text=|trigger=button}{sub-section}{sub-section:removeAllItems_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeAllItems_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItems_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeAllItems_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItems_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeAllItems_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeAllItems_sam|trigger=none}{code:language=javascript}
// Remove all items from the menu.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// remove all menu items from the selected menu
menu.removeAllItems();
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeItem|class=node}{tr:id=name}{td}h6.removeItem{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}removeItem{span}{span:id=iets|style=float: left;}\(index 1, \[index 2-n\]){span}{td}{tr}{tr:id=des}{td}{sub-section:removeItem_des|text=|trigger=button}{sub-section}{sub-section:removeItem_des|trigger=none|class=sIndent}Remove the item(s) at the selected index/indices.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:removeItem_snc|text=|trigger=button}{sub-section}{sub-section:removeItem_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:removeItem_prs|text=|trigger=button}{sub-section}{sub-section:removeItem_prs|trigger=none|class=sIndent}index 1
\[index 2\-n\]
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:removeItem_ret|text=|trigger=button}{sub-section}{sub-section:removeItem_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:removeItem_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItem_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:removeItem_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItem_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:removeItem_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:removeItem_sam|trigger=none}{code:language=javascript}
// Remove the item(s) at the selected index/indices.
// get the menu at the last index
// indexes start at 0 (zero) so index 2 is in fact position 3
var menu = plugins.window.getMenu(plugins.window.getMenuCount() - 1);
// remove only one item at the selected index
// from the selected menu
// menu.removeItem(0);
// remove more than one item at the selected indices
// from the selected menu
menu.removeItem(1,2);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setEnabled|class=node}{tr:id=name}{td}h6.setEnabled{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setEnabled{span}{span:id=iets|style=float: left;}\(enabled){span}{td}{tr}{tr:id=des}{td}{sub-section:setEnabled_des|text=|trigger=button}{sub-section}{sub-section:setEnabled_des|trigger=none|class=sIndent}Set the the selected menu enabled or disabled.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setEnabled_snc|text=|trigger=button}{sub-section}{sub-section:setEnabled_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setEnabled_prs|text=|trigger=button}{sub-section}{sub-section:setEnabled_prs|trigger=none|class=sIndent}enabled
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setEnabled_ret|text=|trigger=button}{sub-section}{sub-section:setEnabled_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setEnabled_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabled_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setEnabled_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabled_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setEnabled_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setEnabled_sam|trigger=none}{code:language=javascript}
// Set the the selected menu enabled or disabled.
var menu = plugins.window.getMenu(0);
menu.setText("Hello");
menu.setMnemonic("H");
menu.setEnabled(false);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setIcon|class=node}{tr:id=name}{td}h6.setIcon{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setIcon{span}{span:id=iets|style=float: left;}\(icon){span}{td}{tr}{tr:id=des}{td}{sub-section:setIcon_des|text=|trigger=button}{sub-section}{sub-section:setIcon_des|trigger=none|class=sIndent}Set the icon of the menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setIcon_snc|text=|trigger=button}{sub-section}{sub-section:setIcon_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setIcon_prs|text=|trigger=button}{sub-section}{sub-section:setIcon_prs|trigger=none|class=sIndent}icon
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setIcon_ret|text=|trigger=button}{sub-section}{sub-section:setIcon_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setIcon_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setIcon_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setIcon_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setIcon_sam|trigger=none}{builder-show:permission=edit}{code:language=javascript}
{code}{builder-show}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setMnemonic|class=node}{tr:id=name}{td}h6.setMnemonic{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}setMnemonic{span}{span:id=iets|style=float: left;}\(mnemonic){span}{td}{tr}{tr:id=des}{td}{sub-section:setMnemonic_des|text=|trigger=button}{sub-section}{sub-section:setMnemonic_des|trigger=none|class=sIndent}Set the mnemonic of the selected menu.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:setMnemonic_snc|text=|trigger=button}{sub-section}{sub-section:setMnemonic_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:setMnemonic_prs|text=|trigger=button}{sub-section}{sub-section:setMnemonic_prs|trigger=none|class=sIndent}mnemonic
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:setMnemonic_ret|text=|trigger=button}{sub-section}{sub-section:setMnemonic_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:setMnemonic_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:setMnemonic_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:setMnemonic_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:setMnemonic_sam|trigger=none}{code:language=javascript}
// Set the mnemonic of the selected menu.
var menu = plugins.window.getMenu(0);
menu.setText("Hello");
menu.setMnemonic("H");
menu.setEnabled(false);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
or at the end.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe checkbox icon (can be an image URL or the image content byte array)ret
Returns
sIndent checkboxclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddCheckBoxname
addCheckBox(name, feedback_item, icon, mnemonic)
dessIndent
Add a checkbox at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe checkbox icon (can be an image URL or the image content byte array)mnemonicthe checkbox mnemonicret
Add a checkbox at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe checkbox icon (can be an image URL or the image content byte array)mnemonicthe checkbox mnemonicenabledthe enabled state of the checkboxret
Add a checkbox at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe checkbox text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe checkbox icon (can be an image URL or the image content byte array)mnemonicthe checkbox mnemonicenabledthe enabled state of the checkboxalignthe alignment typeret
Returns
sIndent checkboxclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuname
addMenu()
dessIndent
Add a submenu at the end.
ret
Returns
sIndent the submenuclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuname
addMenu(index)
dessIndent
Add a submenu at the selected index (starting at 0).
prs
Parameters
sIndentindexthe index at which to add the submenuret
Returns
sIndent the submenuclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuname
addMenu(name)
dessIndent
Add a submenu with given name.
prs
Parameters
sIndentnamethe text of the submenu; this can be also html if enclosed between html tagsret
Returns
sIndent the submenuclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem()
dessIndent
Add a menu item.
ret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem(index)
dessIndent
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentindexthe index at which to add the menu itemret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem(name)
dessIndent
Add a menu item with given name.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem(name, feedback_item)
dessIndent
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functionret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem(name, feedback_item, icon)
dessIndent
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe menu item icon (can be an image URL or the image content byte array)ret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddMenuItemname
addMenuItem(name, feedback_item, icon, mnemonic)
dessIndent
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe menu item icon (can be an image URL or the image content byte array)mnemonicthe menu item mnemonicret
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe menu item icon (can be an image URL or the image content byte array)mnemonicthe menu item mnemonicenabledthe enabled state of the menu itemret
Add a menu item at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe menu item text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe menu item icon (can be an image URL or the image content byte array).In NGClient we also support fontawesome class.mnemonicthe menu item mnemonicenabledthe enabled state of the menu itemalignthe alignment typeret
Returns
sIndent menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioButtonname
addRadioButton()
dessIndent
Add a radio button.
ret
Returns
sIndent a radio button menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioButtonname
addRadioButton(index)
dessIndent
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentindexthe index at which to add the radio buttonret
Returns
sIndent a radio button menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioButtonname
addRadioButton(name)
dessIndent
Add a radio button with given name.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsret
Returns
sIndent a radio button menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioButtonname
addRadioButton(name, feedback_item)
dessIndent
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functionret
Returns
sIndent a radio button menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioButtonname
addRadioButton(name, feedback_item, icon)
dessIndent
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe radio button icon (can be an image URL or the image content byte array)ret
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe radio button icon (can be an image URL or the image content byte array)mnemonicthe radio button mnemonicret
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe radio button icon (can be an image URL or the image content byte array)mnemonicthe radio button mnemonicenabledthe enabled state of radio buttonret
Add a radiobutton at the selected index (starting at 0) or at the end.
prs
Parameters
sIndentnamethe radio button text; this can be also html if enclosed between html tagsfeedback_itemthe feedback functioniconthe radio button icon (can be an image URL or the image content byte array)mnemonicthe radio button mnemonicenabledthe enabled state of radio buttonalignthe alignment typeret
Returns
sIndent a radio button menu itemclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddRadioGroupname
addRadioGroup()
dessIndent
Add a radiogroup for radiobuttons. A radiogroup groups together all radiobuttons that are added
after the group is added. From all radiobuttons that belong to the same radiogroup only one can be
checked at a time.
If no radiogroup is added, one is created automatically when the first radiobutton is added.
clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddSeparatorname
addSeparator()
dessIndent
Add the separator at the selected index (starting at 0) or at the end (empty).
clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowaddSeparatorname
addSeparator(index)
dessIndent
Add the separator at the selected index (starting at 0) or at the end (empty).
prs
Parameters
sIndentindexthe index at which to add the separatorclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowdoClickname
doClick()
dessIndent
Script the selection (emulate a mouse click) of the menu.
clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetCheckBoxname
getCheckBox(index)
dessIndent
Get the checkbox at the selected index (starting at 0).