Customizable Tooltip and Popup Menus

In addition to open a popup when user right-clicks a component, ZK can open a popup under other circumstances.

Property

Description

context

When user right clicks a component with the context property, the popup or menupopup component with the specified id is shown.

tooltip

When user move the mouse pointer over a component with the tooltip property, the popup or menupopup component with the specified id is shown.

popup

When user clicks a component with the popup property, the popup or menupopup component with the specified id is shown.

For example,

<window title="Context Menu and Right Click" border="normal" width="360px">
    <label value="Move Mouse Over Me!" tooltip="editPopup"/>    
    <separator bar="true"/>    
    <label value="Tooptip for Another Popup" tooltip="any"/>    
    <separator bar="true"/>    
    <label value="Click Me!" popup="editPopup"/>    

    <menupopup id="editPopup">    
            <menuitem label="Undo"/>            
            <menuitem label="Redo"/>            
            <menu label="Sort">            
        <menupopup>        
            <menuitem label="Sort by Name" autocheck="true"/>            
            <menuitem label="Sort by Date" autocheck="true"/>            
        </menupopup>        
            </menu>            
    </menupopup>    
    <popup id="any" width="300px">    
        <vbox>        
            ZK simply rich.            
                                    <toolbarbutton label="ZK your killer Web application now!"href="http://zk1.sourceforge.net"/>                                    
        </vbox>        
</popup>
</window>

Notice that you can specify any identifier in the popup, tooltip and context properties, as long as they are in the same page. In other words, it is not confined by the ID space.