Learn WorkXpress
![]() | Create an Item of Type...Use this Action Type to automatically create a new Item of whichever Item Type you choose. |
-

Block Association
Show Technical DetailsBlock Association is the tie that binds all WorkXpress Blocks to each other and enables them to work together. There are permanent, global Block Associations and temporary, local ones. First, all Blocks are permanently associated with either an Item Type or Relationship--this defines an application's structure. Second, Layouts and Fields can permanently nest inside of Layouts to create your interface. Third, Actions can permanently nest inside of Actions to create logic. Finally, at any point in time, a Layout, Field, or Action will temporarily be "about" a particular Item in the database, to give context.
Introduction:
- Block Association makes WorkXpress unique and powerful as an application development tool. It's the glue that connects all WorkXpress Blocks to each other.
- Permanent Block Associations define the application's structure.
- Temporary Block Associations give the interface and logic "context", which helps the application to interact with the database at a point in time.
Permanent (Global) Block Associations
Item Type or Relationship Type AssociationThe most basic type of all Associations, this defines your application structure. At the topmost level, an application is a group of Item Types. These Item Types may have associated Relationship Types. Collectively, all other Blocks in WorkXpress then are associated ultimately with an Item Type. Therefore, an "application" is defined as a set of Item Types and all their associated Blocks.
When searching for Blocks in the build tools, you will tend to find them by first beginning your search on a particular Item Type or Relationship Type, and viewing their associated Blocks.
This choice of Association also effects data backup and restoration.
Blocks with permanent Item Type Association only: Relationships
Blocks with permanent Item Type or Relationship Type Association: Layouts, Fields, Actions
Layout AssociationTo build an interface you must nest Layouts and Fields inside of other Layouts. This nesting generates Layout Association.
Blocks with permanent Layout Association: Layouts, Fields
Action AssociationTo build a logic model (aka business rules, scripting, etc.) you must nest Actions inside of other Actions within a procedure.
Blocks with permanent Action Assocation: Actions
Global and Local Actions
Actions may be associated with an event and block globally, or they may be associated locally. A "Global Action" exists everywhere and every time the Action's parent Block undergoes that same event. A "Local Action", however, only exists when the Action's parent block undergoes this specific event, in this context. In this case though, context refers to the context of the triggering Block within the interface, not the Item context. This is a unique kind of context.
In other words, although a Field may trigger a local Action when it is saved from within one Layout, it will not trigger that same local Action when it is saved from within a different Layout. In both cases, however, its global save Actions will be triggered from either Layout.
For example, for a certain Field, Action A is global to its "Field Save" event for all pages and Action B is local to its "Field Save" event for a specific page. Later, that same Field is added to a new page. When that new page is saved, Action A will fire, but Action B will not exist at all on that page (in that unique context).
Item Association and Context
An Action is always associated with the building block for whom it is a "local" or "global" action (see below). Placing an Action in the Action Manager will result in that Action being associated with an Item Type based on where it is placed. Actions may be associated with Layouts, Fields, Items, or Relationships.
Similarly, an Action typically requires context to function properly. That context comes from the Block for whom this Action Manager Tool was opened and may not be the same Block for which this Action is a local or global Action. Context and Item Association for an Action may be different.
Further, some Actions can change the context. For example, when a list of Items is passed into an Action Manager from a "Mass Action" button in Layout Type - List, the context is each of the Items passed. However if they pass through a "foreach" control structure, the subsequent context passed to subordinate action is that of a single one of the Items in the list, changing each time the loop is repeated.
Temporary (Local) Block Association
Temporary Item Association (Context)At any given time, what is the page you are on "about"? If the page is about a company, then the context of that page is the specific company it is displaying (e.g. "Acme Company", where Acme Company is an "Item" in the database of "Type" Company). Any Fields or Actions need to be about that specific item and not some other item (i.e. about "Acme company and not some other company), so those Fields or Actions need to be provided with this context. For a much more detailed examination of this concept, which is critical to successfully building applications with WorkXpress, please see our lesson about Context.
If the page is about a specific Item of Type: User...for example the "current user"...then perhaps it is about you? When the page displays data, it needs to display that data about you. When Actions on the page shoot off an email notifying of a change to username, it needs to shoot that email to you, not to some other User. YOU are an Item in the database of Type User, and are also the context in this second example.
Context then is the specific Item (Not Item Type) in the database which the current Layout, Field or Action is displaying data about.
Blocks with temporary Item Association: Layouts, Fields, Actions
-

Associated Actions



