|
NAMEReaction::UI::ViewPort - Page layout building blockSYNOPSIS# Create a new ViewPort: # $stack isa Reaction::UI::FocusStack object my $vp = $stack->push_viewport('Reaction::UI::ViewPort', layout => 'xhtml'); # Fetch ViewPort higher up the stack (further out) my $outer = $vp->outer(); # Fetch ViewPort lower down (further in) my $inner = $vp->inner(); # Create a named tangent stack for this ViewPort my $substack = $vp->create_tangent('name'); # Retrieve a tangent stack for this ViewPort my $substack = $vp->forcus_tangent('name'); # Get the names of all the tangent stacks for this ViewPort my @names = $vp->focus_tangents(); # Fetch all the tangent stacks for this ViewPort # This is called by apply_events my $stacks = $vp->child_event_sinks(); ### The following methods are all called automatically when using ### Reaction::UI::Controller(s) # Resolve current events with this ViewPort $vp->apply_events($ctx, $param_hash); # Apply current events to all tangent stacks # This is called by apply_events $vp->apply_child_events($ctx, $params_hash); # Apply current events to this ViewPort # This is called by apply_events $vp->apply_our_events($ctx, $params_hash); DESCRIPTIONA ViewPort describes part of a page, it can be a field, a form or an entire page. ViewPorts are created on a Reaction::UI::FocusStack, usually belonging to a controller or another ViewPort. Each ViewPort knows it's own position in the stack it is in, as well as the stack containing it.Each ViewPort has a specific location in the heirarchy of viewports making up a page. The hierarchy is determined as follows: The first ViewPort in a stack is labeled 0, the second is 1 and so on. If a ViewPort is in a named tangent, it's location will contain the name of the tangent in it's location. For example, the first ViewPort in the 'left' tangent of the main ViewPort has location "0.left.0". Several ViewPort attributes are set by "push_viewport" in Reaction::UI::FocusStack when new ViewPorts are created, these are as follows:
METHODSouter
Fetch the ViewPort outside this one in the page hierarchy. inner
Fetch the ViewPort inside this one in the page hierarchy. create_tangent
Create a new named Reaction::UI::FocusStack inside this ViewPort. The created FocusStack is returned. focus_tangent
Fetch a named FocusStack from this ViewPort. focus_tangents
Returns a list of names of all the known tangents in this ViewPort. focus_stackReturn the Reaction::UI::FocusStack object that this ViewPort is in.apply_events
This method is called by the FocusStack object to resolve all events for the ViewPort. apply_child_events
Resolve the given events for all the tangents of this ViewPort. Called by apply_events. apply_our_events
Resolve the given events that match the location of this ViewPort. Called by apply_events. handle_events
Actually call the event handlers for this ViewPort. Called by apply_our_events. By default this will do nothing, subclass ViewPort and implement accept_events. accept_events
Implement this method in a subclass and return a list of events that your ViewPort is accepting. event_id_for
Create an id for the given event name and this ViewPort. Generally returns the location and the name, joined with a colon. sort_by_spec
Sorts the given list of items such that the ones that also appear in the spec are at the beginning. This is called by Reaction::UI::ViewPort::Action and Reaction::UI::ViewPort::ListView, and gets passed column_order as the spec argument. AUTHORSSee Reaction::Class for authors.LICENSESee Reaction::Class for the license.
Visit the GSP FreeBSD Man Page Interface. |