Context

  The selected file /tmp/fileKT487W could not be uploaded, because the destination sites/default/files/css/css_a91cd284035e73ba34d112bfed2f5a16.css is not properly configured.
  The selected file /tmp/fileHjrFQb could not be uploaded, because the destination sites/default/files/css/css_de1aa27776f1462d2b0d83a80ce4b92d.css is not properly configured.

Context

“Context” refers to the specific Item(s) that a Layout, Field, Action, or Relationship will display data about. If an Item is “out of context” then it does not have anything to display data about.

Context is a very important concept in WorkXpress, because it is what enables a Field to display information. Any time a Field is displayed on screen, it must ask the question “what item am I about?”.

Let's take the “Account Address” Field as an example. When loading an Account home-page in view mode, the Address Field must ask the question; “which address do I display here?”. In order to answer that question, it has to know the Context in which it is loading. In our example, the context for the page was “Acme Company”, and therefore the Account Address Field knows to display the address for Acme Company.

Context Inheritance

Context can be passed throughout the interface. This is sometimes referred to as “inheritance,” but more often is called a Block's “parent's map.” For example, in a search list of Accounts, each row has a link with the Account Name text. Each of those links opens the same page and inherits the same Context (Account, from its Parent's Map), but since a different Item was found through that context, the data in the page which will open will be different, depending on the link that was clicked.

Arriving at a specific Account page, this context is now passed to each Layout. We could equivalently say that each Layout inherits the context of the page, or that the Parent's Map for each Layout is Account. Suppose one of the Layouts is a list of Contacts, related to the current Account with an “Employee to Employer” Relationship. In inherits the Account context, but in the Layout Settings, the Query Builder was used to define which Contacts to put in the list. Because of the nature of list Layouts, the context of the body of the list is Contact (Context has been changed), wherein each link displays a different Contact Name. Clicking on any one of those links launches a page about Contacts, and now has the Context of the specific link that was clicked. In this way, Context can be passed throughout an application.

Actions Context

The same idea of inheritance and changing context applies to Actions in the Action Manager. If an action is attached to a page about an Account, the action inherits the Account context. If, on that same page, an Action is attached to a Field in a list of Contacts, though, the action will inherit the Contact context. There are some Actions which, because of the nature of what they do, will change the context of each Action attached to them. For instance, if a “for each” loop is attached to the page about an Account, it will inherit the Account Relationship; however, if the “for each” is configured to loop over each Contact related to the Account, each action attached to the “for each” loop will recieve the Contact context. Similarly, each Action attached to an Item create Action will inherit the context of whichever Item is being created.

Editing a Block "in context"

When you access the Block Editor Tool by navigating to that Block from within the application, the settings for that Block will be in context. This means that those settings will be true and accurate according to point in the application you are at, at that time. These settings will most closely represent an actual user's experience. This concept applies to Layouts, Fields, and Actions.

Editing a Block "out of context"

When you access the Block Editor Tool by some method other than navigating from within the application, you are likely editing the Block “out of context”. This means that some settings which require context will not exist or will be nonsensical. A good example is a data driven “header title” setting for a Layout: If you did not navigate to that Layout from within the application and then click on its blue Block to edit it, which piece of data will the system use to drive the data driven header title? This concept applies to Layouts, Fields, and Actions.

See Also:

start/in context.txt · Last modified: 2016/09/14 18:19 (external edit)
Copyright WorkXpress, 2024