company logo

Associate - Associate entry from base collection (Ctrl+Shift+F5)

The action associates an entry from the base collection defined for the data source to the data source (in front of the selected entry). When no base collection has been defined for the data source (superset in data model or base collection in GUI data source), the action is disabled.

The action pops up with a standard Associate dialog, which shows the entries from the base collection. From the list, one may select one or more entries to be added to the data source. The Associate dialog might be redefined by providing an associate control in the GUI class for the data type of the data source.

After selecting one or more items, selected items are, usually, added to the data source (which is a collection, typically) by calling action InsertEntry. Before calling InsertEntry, string data is stored to the control's text area and the doBeforeStoreData() handler is called. Thus, each associated entry may be handled by the doBeforeStoreData() handler rather than by the default associate handling. When the handler had been implemented, it should return true (error) in order to suppress InsertEntry action.

// OSI implementation

FUNCTION virtual int32 myClass :: doBeforeStoreData ( ) {

  if ( !text().isEmpty() )

    ; // do something with text()

  return(true); // suppress InsertEntry action

}