Smart CODE
Your on-line guide to the generated code

NAME
Groups - The Group Data Object

INTRODUCTION
The Group data object is intended for use both by programmers and by X-Designer generated software. Programmers will use the member elements corresponding to each of the controls that make up the group. The alternate (private) API, which is intended for automatic group processing in the transport layer needs to handle all groups the same way (without access to named member controls), includes an array of member controls, a count of the number of controls in the group, and methods to recognize public/private elements, to enumerate the elements and to update the interface.

The code for automated group processing is found in the group base class in Java and C++. In C, a number of fields at the start of the group data structure are shared between the base AnyGroup_t and each specific group instance, a technique that will be familiar to programmers who have worked with X events.

The automated API is not intended for use by programmers, and is currently private. It is mentioned here to explain why example code will often cast the group object in a smart code data structure to the appropriate type.

The group object is only intended as a container for the elements in the group. The code that handles creation of the group object, in the directory groups_<c|cpp|java> has the same status as the X-Designer code file. it is regenerated each time. All other smart code files are regenerated only if they are not present, and are required.

SYNOPSIS

C


Base structure AnyGroup_t;

each instance GROUPNAME`_t has the AnyGroup_t private data elements as the first
fields in the structure.

C++


Base class sc_group_c

each instance GROUPCLASS subclasses sc_group_c

Java


Base class SCGroup

each instance GROUPCLASS subclasses SCGroup

DESCRIPTION

USAGE
The Group data structures/classes are intended to be created by X-Designer in the code that is generated to prime callbacks. They are used as containers to allow callouts access to individual controls in the group, and to allow software to process the group elements automatically.

To program using the Group data structure, you will need to know the names of the controls and extra data elements that comprise the group. On the client side, each element will have one or more getters and setters corresponding to resources that represent the data the user has entered/selected in the control. One such resources is taken as the "default" or characteristic resource for the control, and this is sent down to the server.

The Group data structure is the same on the Server side. The only difference is that the controls on the server side are simple dataobjects such as booleans, strings and integers, and not complex user interface controls. They are also accessed through a single get()/set() pair. The server side group members have a single value that corresponds to the default value of the control on the client side.

EXAMPLES
Examples of getters and setters can be found in the section on Get/Set Smart Code callouts

SEE ALSO
The Smart Code Data Object, User Interface Controls as group members