Open topic with navigation
Commands provide a mechanism that allows application components to invoke functionality without knowing who the actual implementer(s) are. They live inside of the application’s
CommandRegistry object. Referencing a non-existent command simply creates a new empty command.
Commands are invoked by name and can have zero or more implementations registered. These implementations are executed sequentially when a command is invoked. Since commands can be invoked from workflows via the
RunExternalCommand activity, it is better to keep command parameters as simple as possible.
Commands do not return results, and should generally not modify their arguments.
Events are similar to commands. Events allow components to respond to events in a system. Events, like commands, are referenced by name and contain zero or more pieces of functionality that are executed sequentially when the event is published.
See Viewer Commands and Events for more information.
Modules that interact with each other should always do so via commands and events. Modules should never have explicit coupling. Removing one module should not break another.
Geocortex Viewer for HTML5 2.5 introduces the notion of application states. States are a means to provide context as to what is currently happening in the viewer. States are entered or exited when a certain command runs, a specific event occurs, or in response to user activity. For example,
IdentifyState is activated when the Identify tool becomes active.
There are two kinds of states:
Global States: Only a single global state can be active at a time. If a new global state activates, the previous one becomes inactive. For example,
IdentifyState cannot be active at the same time as
MeasureState. A global state can, however, be active at the same time as any number of non-global states.
Non-global States: Any number of non-global states can be active simultaneously—regardless of whether a global state is active or not. For example,
SnappingState can be active simultaneously.
There is also a default non-modal state,
DefaultState, which is always active, even when no other states are active.
States are typically associated with:
Toggle buttons, which can be configured in Geocortex Essentials Manager.