How do I click a command by codes on right side menu?

50 Views Asked by At

I have a command added to the right-side menu of a form. I want to click the command by code but the pointerPressed() is for components and pressed() is for buttons.

A Command is not a component. How do I click a command by codes?

1

There are 1 best solutions below

4
Shai Almog On

Actually there is a button, we just make it for you. Use:

Button btn = toolbar.findCommandComponent(cmd);

You can then use events and customize the appearance of the Button as you would with any Button.