company logo

ControlContext :: field - Get context by field or button name

The function searches for a subordinated field context with the name passed sField. When a name has been used several times, the function returns the context for the first field with the given name. Since field names are defined in the context of the owning control, field names should be unique (but need not).

When not passing a field name or when passing an empty field name, the function returns the context of the current control.

The field name might be defined as context path, which refers to the field hierarchy starting with the current control. In contrast to control() and button(), the function uses the field name hierarchy rather than the control name hierarchy.

In order to go up one or more levels in the hierarchy, a corresponding number of dots may precede the path.

field("my_city");            // search my_city field in current control

field("..my_city");          // search my_city field in parent-parent-control

field("my_address.my_city"); // search my_city field in subordinated address form

field(".");                  // return the parent control

Return value:  Control context ( odabagui::ControlContext & )

ControlContext classes are created for field (ADK_Field) as well as for control (ADK_FieldControl) resources.

When referring a field resource, the field context will overload the context implemented for the subordinated field control (control context).

Implementation details

odabagui::ControlContext & ControlContext  :: field ( odaba::String &sField )
  • sField - Field name

    The field name is the name of the field resource (ADK_Field) as being defined within the control.