Reaction::UI::Window - Container for rendering the UI elements in


  my $window = Reaction::UI::Window->new(
    ctx => $ctx,
    view_name => $view_name,
    content_type => $content_type,
    title => $window_title,

  # More commonly, as Reaction::UI::Controller::Root creates one for you:
  my $window = $ctx->stash->{window};

  # Resolve current events and render the view of the UI
  #  elements of this Window:
  # This is called by the end action of Reaction::UI::Controller::Root

  # Resolve current events:

  # Render the top ViewPort in the FocusStack of this Window:

  # Render a particular ViewPort:

  # Or in a template:
  [% window.render_viewport(self.inner) %]

  # Add a ViewPort to the UI:


A Window object is created and stored in the stash by Reaction::UI::Controller::Root, it is used to contain all the elements (ViewPorts) that make up the UI. The Window is rendered in the end action of the Root Controller to make up the page.

To add ViewPorts to the stack, use the "push_viewport" in Reaction::UI::Controller method. For more detailed information, read the Reaction::UI::FocusStack and Reaction::UI::ViewPort documentation.


These are set for you by "begin" in Reaction::UI::Controller::Root from your Root controller configuration.


Arguments: $ctx?

The current Catalyst context object.


Arguments: $viewname?

Retrieve/set the name of the Catalyst::View component used to render this Window. If this has not been set, rendering the Window will fail.


Arguments: $contenttype?

Retrieve the content_type for the page. If this has not been set, rendering the Window will fail.


Arguments: $title?
  [% window.title %]

Retrieve/set the title of this page, if not set, it will default to "Untitled window".


Arguments: none

Retrieve the Catalyst::View instance, this can be set, or will be instantiated using the view_name class.


Arguments: none

Retrieve the stack of ViewPorts that contains all the UI elements for this Window. Use "push_viewport" in Reaction::UI::FocusStack on this to create more elements. An empty FocusStack is created by the Controller::Root when the Window is created.



Arguments: none

Synchronize the current events with all the Reaction::UI::ViewPort objects in the UI, then render the root ViewPort. This is called for you by "end" in Reaction::UI::Controller::Root.


Arguments: none

Resolves all the current events, first the query parameters then the body parameters, with all the Reaction::UI::ViewPort objects in the UI. This calls "apply_events" in Reaction::UI::FocusStack. This method is called by flush.


Arguments: none

Renders the page into the Catalyst::Response body, unless the response status is already set to 3xx, or the body has already been filled. This is done via "render_window" in Reaction::UI::View. This method is called by flush.


See Reaction::Class for authors.


See Reaction::Class for the license.