Skip to main content

Reads the context of the closest enclosing component of another type.

Use it when a nested component needs something from an ancestor, for example a custom button inside a dialog:

name is the component with its namespace, as you write its tag, and as the variable that receives its context. A component reads its own context through the context variable. Asking ui:context for it throws an exception.

With provider it reads the context a <component>.provider created instead, from anywhere after the provider, also outside a component:

Name Type Description Required Default
name string The component with its namespace, as you write its tag (e.g. "ui:fileUpload") Yes -
as string Variable name to assign the result to No ''
provider string The id of a &lt;component&gt;.provider to read the context of, instead of the closest enclosing component. No ''