Class: cWebCommandBar

Properties  Events  Methods    Index of Classes

The Web Framework menu and toolbar container



Library: Web Application Class Library

Package: cWebCommandbar.pkg


cWebCommandbar is a special wrapper object for your web application's global menu and toolbars. The command bar object is designed to position your menus and toolbars outside and above the area occupied by your web views (cWebView). The command bar also manages notification events that need to be sent to menu items (for example OnChangeRights).

A web application can contain, at most, one command bar object. This should be located inside your application's cWebApp object.

A command bar is normally only used in a desktop style web application. If your web application uses the mobile/tablet style and drill down navigation interface, you would normally use a cWebMenuButton control as a menu container.

A command bar will contain, at most, one menu bar object (cWebMenuBar) and any number of toolbars (cWebToolBar). Menu bars and toolbars are, in turn, constructed from nested menu item objects (cWebMenuItem).


Object oWebApp is a cWebApp
    WebSet pbEnabled of oWebCremeItem to True

    Object oCommandbar is a cWebCommandBar
        Object oMenuBar is a cWebMenuBar

            Object oViewMenu is a cWebMenuItem
                Set psCaption to "Views"
                Object oCustomerMenuItem is a cWebMenuItemLoadView
                    Set psCaption to "Customer Maintenance"
                    Set psLoadViewOnClick to "oWebCustomer"
            Object oThemes is a cWebMenuItem
                Set psCaption to "Themes"

                Object oModernSky is a cWebMenuItem
                    Set psCaption to "Modern Sky"
                    Procedure OnClick 
                        WebSet psTheme of oWebApp to "Vdf_Modern_Sky"
        Object oFindToolBar is a cWebToolBar
            Object oFirstMenuItem is a cWebMenuFindFirst
            Object oPreviousMenuItem is a cWebMenuFindPrevious

            Object oFindMenuItem is a cWebMenuFind

            Object oNextMenuItem is a cWebMenuFindNext
            Object oLastMenuItem is a cWebMenuFindLast

    Use WebServiceDispatcher.wo
    Use SessionManager.wo
    Use WebCustomer.wo

The above sample demonstrates a cWebApp containing a typical command bar structure with a menu bar and one toolbar. Notice that some of the menu item objects use specialized classes that are designed for a specific purpose e.g. cWebMenuFindFirst.

Object Name

The Web Framework uniquely identifies each web object via a combination of the object hierarchy (object nesting), and object name. This means that web object names must be unique within their parent (i.e. each sibling web object must have a unique name).

Object Placement

Your cWebCommandBar object must be placed within the main web application object (cWebApp).

By default, a cWebCommandBar spans the entire width of the screen (the amount of space it gets in HTML). the height stretches to fit its contents and its basic height is defined by the theme (psTheme).

Drag and Drop Support

This control can be used as a valid drop target by registering it as such in a cWebDragDropHelper object.

The supported actions for this control are:
- C_WebDropOnControl

This allows the control to accept data dragged from elsewhere in the control (if configured that way) and can also be used to accept files when registered within a cWebDragDropFileHelper.