Interface IContainerContext

All Superinterfaces:
IEventContext, IPortalContext, Serializable
All Known Implementing Classes:
ContainerContext

public interface IContainerContext extends IEventContext
The container context provides in addition to the portal context some methods that are relevant during the execution of container methods.
Since:
5.0
Author:
O. Kerpershoek
  • Method Details

    • getContainerId

      String getContainerId()
      This method will return the id of container that can be used to uniquely identify the container. The container id is stable over refreshes and reloads.
      Returns:
      The id of the container.
    • getContainerName

      String getContainerName()
      This method will return the name of the container that the dynamic container component was applied to. This name is thus equal to the name of the container as defined in the Everest Studio.
      Returns:
      The name of the container.
    • getParameter

      String getParameter(String name)
      This method will return the value for the parameter with the specified name. When no value was found for the given name, the null value will be returned.
      Parameters:
      name - String containing the name of the parameter for which the value is requested.
      Returns:
      The value of the parameter for the specified name.
    • getParameters

      ITypedParameters getParameters()
      This method will return all the parameters defined for the container at once in a single object.
      Returns:
      Object containing all the parameters for the container.
    • registerCallback

      void registerCallback(IElement element, ICallbackFunction function, InvocationType when)
      This method may be used to add a callback function to an element of the container. The callback function will be invoked depending on the invocation type.

      The following invocation types are supported:

      • ALWAYS The callback function should always be invoked for both page submits and refreshes, regardless of the element that triggered the event.
      • ON_SUBMIT The callback function should always be invoked when the page is submitted, but not invoked upon a page refresh.
      • ON_EVENT The callback function should only be invoked when the element, that the callback was registered for, caused the event. This type is usually applicable when registering a callback for a button or (refresh) field. The callback function will be invoked for both refresh and submit events.

      The callback registered by a container will be executed in the order they are found on the page. This means that the callback of a container will be invoked before any callback that is registered for it's child elements. The callback functions will be handled just like services, and as such the same rules apply. When a callback function sets an error in the context, the flow will be blocked, the current transaction aborted, and the previous page will be shown.

      Parameters:
      element - The element for which the callback function is added.
      function - The callback function that should be invoked during the page submit/refresh.
      when - The invocation type parameter specifies when the callback should be invoked.
    • getErrors

      IErrorMessage[] getErrors(boolean onlyGenericErrors)
      Returns the error messages (never null) that have been set in the request scope. When no errors have been an empty array will be returned.
      Specified by:
      getErrors in interface IEventContext
      Parameters:
      onlyGenericErrors - Boolean indicating if only generic error messages should be returned.
      Returns:
      Array containing the errors that have been set on the request scope.
    • getErrors

      IErrorMessage[] getErrors(ValueReference attributeReference)
      Retrieves the errors for a specific ValueReference (never null) When no error messages have been set for the specified attribute, an empty array will be returned.
      Specified by:
      getErrors in interface IEventContext
      Parameters:
      attributeReference - Reference to the attribute for which the error messages are requested.
      Returns:
      Array containing the error messages for the specified attribute (may be empty).