cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Toggle menuitems using AOM/DOM

unknown1
1-Newbie

Creating Toggle menuitems using AOM/DOM

Hello,



I am trying to create a toggle menu item using the AOM and DOM. I found
when trying to use:

public void setChecked(boolean checked)

throws WindowExceptionFor toggle menu items only. Shows
whether the toggle menu item is checked or not.

Throws:

WindowException - INVALID_MODIFICATION_ERR: Raised if the object is not
a toggle menu item.



I get an error because it is not a toggle menu. I am using the following
to create the menuitem:



public MenuItem createMenuItem(java.lang.String label)

Creates a menu item.

Parameters:

label - Specifies the label of the menu item. If this value is a dash
(-), the method returns a menu separator (a horizontal line) that
distinguishes groups of items on a submenu. Specify an access key in the
label by placing an ampersand ( &) before the character to be used as
the key. For example, to specify the F as the access key for "File",
specify the label as &File. The character that follows the ampersand in
a label is also known as the mnemonic of the menu item.

Returns:

The newly created MenuItem



But I can't find any documentation that tells me how to create a toggle
menu in AOM/DOM. I have searched documentation for toggle and only find
it in regards to setChecked() and getChecked() but can't find any way to
create a toggle menu.



Can anyone tell me what I am missing?



Thanks,

Deb






3 REPLIES 3

Hello! I have this problem too. Can anybody answer?


It is inconvenient to split logic into acl and java files.

Hi Ilya--



If you don't want to keep things in separate files, you could always
"cheat" with Acl.execute() in AOM...



Acl.execute("menu_add -menu 'Help' 'Custom");



I'm not sure if there's a way to do it in "pure" AOM, i.e. without
resorting to ACL of some kind. There may well be a way, but I haven't
really dug into it to try and figure it out.



--Clay





Clay Helberg

Senior Consultant

TerraXML


In the Arbortext Customizer's Guide (Help -> Help Center -> Programming -> Customizer's Guide ->Arbortext Customizer's Guide) in the section Working with Menus, there is an example that shows how to create toggle menu items in ACL. Once they are created, you should be able to toggle them in Java. I know it's not a complete Java solution, but this might at least get you up and running.

Announcements