Execute a Menu Command

A menu command is associated with a menu item. There are two ways to associate a command to it: the onClick event and the href property. If a event listener is added for a menu item for the onClick event, the listener is invoked when the item is clicked.

<menuitem onClick="draft.save()"/>

On the other hand, you could specify the href property to hyperlink to the specified URL when a menu item is clicked.

<menuitem href="/edit"/>
<menuitem href="http://zk1.sourceforge.net"/>

If both of the event listener and href are specified, they will be executed. However, when the event listener get executed in the server, the browser might already change the current URL to the specified one. Thus, all responses generated by the event listener will be ignored.