Previous | Next
WireHose Developers Guide

Using the layout dictionary

WHSessionHelper provides your primary access to the layout dictionary. To resolve bindings such as helper.@itemInArea.someKey, the session helper will look in the dictionary at the most specific place possible to resolve the value for someKey in the current component. For itemInArea, that is the current area, in the current page, in the current layout. If a value isn't found at that location in the dictionary, WHSessionHelper will look at the next most specific place, and so on, until it finds a value. It then caches the value at the original place it looked so the value is immediately available the next time it is needed.

How WireHose resolves layout dictionary values

Here's the order in which WHSessionHelper attempts to resolve values in the layout dictionary for area-level bindings:

  1. Area in current page
  2. Area in current wrapper
  3. Current page
  4. Current wrapper
  5. Area in default page
  6. Area in default wrapper
  7. Default page
  8. Default wrapper

To resolve page-level bindings, the session helper starts at the current page, and skips the area-level bindings:

  1. Current page
  2. Current wrapper
  3. Default page
  4. Default wrapper

Layout dictionary structure

The layout dictionary consists of a nested hierarchy of dictionaries, arrays and constant values:

 {
     defaults = {
         wrapper = {
             areas = {
                 areaName = {
                     componentName = {
                        ...
         pages = {
             pageName = {
                 areaName = {
                     componentName = {
                        ...
     };
     layouts = {
         layoutName = {
             wrapper = {
                 areas = {
                     areaName = {
                         componentName = {
                            ...
             pages = {
                 pageName = {
                     areaName = {
                         componentName = {
                            ...
}

See the WHSessionHelper documentation for methods such as itemInArea(String) and itemInPage(String) for the specific keypaths checked while resolving items.


Previous | Next