appglobalalert TacAppGlobalAlert component
Hierarchy Properties Methods Events
Return to Introduction  Previous page  Next page
The acAppGlobalAlert component is the small utility which helps you to receive special "alert events" in various places (forms, units) of your application, when you need to take some specific action in another forms. One acAppGlobalAlert component, connected to other GlobalAlerts, informs others to trigger OnAlert event.  
Imagine following situation: you have several forms and want to notify each of that forms about some special event. You drop the acAppGlobalAlert components on each form, connect GlobalAlert components each to other (specifying other "alerts" in the GlobalAlert property), then call Alert method from any place of your application. All connected components will fire the OnAlert event, which might notify each form about need to take some specific action.  
Another example from life: you have 2 forms, master (main application form) and slave (dialog form) and each of them have a list of some items. You need to refresh the lists when its items are updated on any form. You need to drop "alert" components on these forms, and connect acAppGlobalAlert on the slave form with main AppGlobalAlert, by specifying GlobalAlert property, then write OnAlert event handlers at both components, which will refresh the lists. So, when user edits any lists and, for example, clicks "Apply" button on the form, you need to call the Alert method on the acAppGlobalAlert component, so each other acAppGlobalAlert's will trigger OnAlert events, which refreshes the lists on each form. Additionally, Alert method can pass some important information to others connected component (their event handlers, see parameters of this method and event).  
The component is very simple. It have only one property, one method and one event:  
·GlobalAlert property — connector to the main acAppGlobalAlert component. Should be only in secondary acAppGlobalAlert's.  
·Alert method — triggers the OnAlert event in each component, connected to main acAppGlobalAlert, which specified in GlobalAlert property, or connected to current component, and passes some information to the events of others connected components (see parameters of the method).  
·OnAlert event — notifies about some specific action, when application calls the Alert method in any connected acAppGlobalAlert.  

See also
acAppGlobalSwitch component.