Uniface Sample: Form Containers

Uniface 9.6.01
Sample Version: 1.0
December 2012


Demonstrated Functionality

This sample shows how you can use form containers to improve the flexibility of your application and to reuse components. It demonstrates how to:

Sample Description

The sample shows:

Files

This sample consists of the following files:

File name

Description

u96_formcont_readme.html

This file

u96_formcont.xml

Uniface export file containing:

Object

Name

Description

Form

U96_FORMCONT

The main form

Form

U96_FORMCONTDAT

The data area form in Fancy layout

Form

U96_FORMCONTDAB

The data area form in Business layout

Form

U96_FORMCONTSEL

The Select Person form

Form

U96_FORMCONTPRS

The Person Data form

Form

U96_FORMCONTPRJ

The Project Data form

Form

U96_FORMCONTINF

The Readme Data form

Model

U96_FORMCONT

Model definitions for test data

u96_formcont.dat

Test data. You do not need to import this file or create database tables. The sample reads directly from the file.

u96_formcont_confa.png
u96_formcont_confb.png
u96_formcont_corner.png
u96_formcont_ot.png
u96_formcont_pm.png
u96_formcont_po.png
u96_formcont_screen.png
u96_formcont_stucco.png
u96_formcont_swap.png

Pictures that are used in this sample.

Knowledge Prerequisites

To use this sample, knowledge of the following topics is assumed:

Uniface Subject

Knowledge Level

Uniface development

Intermediate

Uniface Proc code

Intermediate


Steps

  1. Add the following line as the first line in the [FILES] section of your IDF assignment file.
    u96*.*     .\samples\u96*.*
  2. Create a subfolder samples in your projects folder.
  3. Unzip file u96_formcont.zip and place its files in your samples folder.
  4. Import the Uniface sources.
    /imp u96_formcont.xml
  5. Compile the Uniface sources.
    /all u96_formcont*
  6. Depending on your deployment configuration you may need to update your URR.
    /urr
  7. Run the sample from outside the IDF
    /tst u96_formcont
  8. Test the form.
    • Select a role and a person and notice that additional information is displayed in yellow sticky notes in the Fancy layout. The sticky notes displayed vary with the role and the person. For example, look at Project Owners Bobby Azevedo and Julia Giddings, Project Manager Kees Vlieringa, and Other person Kenneth Price.
    • Use the radio group at the top of the screen to switch the data area and the readme area.
    • Use the other radio group at the top of the screen to change the look and feel between the Fancy Layout (a dark stucco wall with yellow sticky notes) and the Business Layout (white/blue colors and the data in an stacked tab).
  9. Examine the forms in the Component Editor.

Fancy Layout

In the Fancy Layout, background images and colors create the impression of sticky notes on a wall.

Element

Description

Main Form

Form U96_FORMCONT has form containers for the data and the readme file. At the top of the screen, there is a radio group that swaps the location of the data and the readme containers.

Data Container

Form U96_FORMCONTDAT has form containers for selecting a person, showing person information, showing projects owned by the person and projects managed by the person. Both project containers are loaded with instances of the same form. Notice that the use of form container eliminates the need for entity subtypes in this situation.

Select Person Container

Form U96_FORMCONTSEL is loaded into this container.

Person Data Container

Form U96_FORMCONTPRS is loaded into this container.

Projects Owned Container

Instance PROJECTS_O of form U96_FORMCONTPRJ is loaded into this container.

Projects Managed Container

Instance PROJECTS_M of form U96_FORMCONTPRJ is loaded into this container.

Readme Container

Form U96_FORMCONTINF contains an HTML widget that shows you the Readme file.

Business Layout

In the business layout, traditional colors and an stacked TabEx widget are used to display the data.

Element

Description

Main Form

Form U96_FORMCONT has form containers for the data and the readme file. At the top of the screen there is a radio group that swaps the location of the data and the readme containers.

Data Container

Form U96_FORMCONTDAT has form containers for selecting a person, showing person information, showing projects owned by the person and projects managed by the person. Both project containers are loaded with instances of the same form. Notice that the use of form container eliminates the need for entity subtypes in this situation.

Select Person Container

Form U96_FORMCONTSEL is loaded into this container.

TabEx widget

The person data, projects owned and projects managed forms are show in a Stacked style TabEx widget.

Person Data Tab

Form U96_FORMCONTPRS is loaded into this tab.

Projects Owned Tab

Instance PROJECTS_O of form U96_FORMCONTPRJ is loaded into this tab.

Projects Managed Tab

Instance PROJECTS_M of form U96_FORMCONTPRJ is loaded into this tab.

Readme Container

Form U96_FORMCONTINF contains an HTML widget that shows you the Readme file.

Swap Locations of Data and Readme

In this sample, you can swap the location of the data and the readme information.

The main form U96_FORMCONT has two Form Container widgets. By re-assigning forms to the form containers, the location of the data and readme information is switched. Because form U96_FORMCONTINF with the readme information is wider than form U96_FORMCONTDAT with the data, the Proc function $paintedfieldproperties is used to resize and reposition the form containers.

More Information