A NEW TODAY IS DAWNING!

Sample Application for Toolbars

Introduction

This sample demonstrates the use of toolbar buttons (Toolbar) in an XML Container.


About XML Containers

An XML Containers is a screen control (field) that renders based on XML data supplied to the control at runtime. To use an XML Container, you simply paint a control on a screen and nominate function (FieldAction) to execute when an event occurs. Then you populate the container by sending xml data to the control at runtime.

Use the following steps to add an XML Container to a screen:

  1. Paint the XML Container on the screen. Select the Container Style (i.e. Multicol for listview, TabCtrl for TabView etc).
     
  2. Set the Field Action to a function to execute on an event in the container. For some XML Container types you can also specify a double-click action.
     
  3. Set the InputXML. This is the default xml subset (for example "mytabs") to use to render the container contents on screen display. To re-render the contents, use the SCREEN *RENDER command. The Output XML is not required as this is specified as "@EventSubset" in the Input XML.
     
  4. Set other characteristics for the control such as color, fonts etc. Normally you will want "Perform on Show" to be true.
     
  5. Using the Blob Editor, select "New from Template" and select the desired XML Container type (listview, treeview etc.). Alter the template to suit your requirements. Save the blob.
     
  6. In the Screen source function or the function that calls the screen, create an xml subset from the static blob (i.e. XML *OPEN "mytabs" *BLOB= "tabs").
     
  7. Optionally modify the subset to reflect runtime conditions.
     
  8. When the screen is displayed, the XML Container will render based on the information in the xml subset.

To change the conents of the XML Container after the initial display use the SCREEN *RENDER command.

SCREEN *RENDER "fieldnameref" *SUBSET= "subsetdataref"

Example:

IF L-User = "Advanced" THEN
SCREEN *RENDER "tabfield" *SUBSET= "alltabs"
ELSE
SCREEN *RENDER "tabfield" *SUBSET= "basictabs"
ENDIF

Once rendered, the XML Container will notify the server of events by running the function nominated in "FieldAction". In your event function, read the contents of the subset nominated at "OutputXML" or as specified in your "EventSubset" in the creation xml.

To activate an event in an XML Container other than the user clicking on the control, use the SCREEN *REFRESH command. A *REFRESH will force event logic to be performed.


About the Toolbar XML Container

The Toolbar XML Container is used to display Windows toolbars with the following functionality:

Any number of bitmaps or text buttons can be displayed. Buttons will be displayed left, right, top, down with optional wrapping.

Individual buttons can display a dropdown text menu.

Each tab requires an Id, Label, and optional bitmap.

After display, individual toolbar item properties can be modified using Action="Update".


Example Application

Download the tooldemo application for examples on using the Toolbar XML Container.


XML Schema and Examples

XML Schema XSD for Toolbar and Toolbar Event.

Sample XML for Toolbar Create: Toolbar with dropdown list, Toolbar text dropdown.