| Reaction documentation | Contained in the Reaction distribution. |
Reaction::UI::Widget::Action
This is a subclass of Reaction::UI::Widget::Object::Mutable.
Additionally provides the method argument containing the value of
the viewport's method.
Empty if the viewport's has_message returns false. Otherwise sets
the message_string argument to the viewport's message and
renders the message_layout fragment.
Same as the message fragment above except that it checks
has_error_message, sets message_string to the viewport's
error_message and renders error_message_layout.
share/skin/base/layout/action.tt
The following layouts are provided:
Renders a div element containing a form. The form element contains the rendered
header, container_list, buttons and footer fragments.
Renders the error message.
Simply renders the parent container_list.
Simply renders the parent container.
First renders the message fragment, then the ok_button_fragment, the apply_button_fragment
and the cancel_button_fragment.
Renders the message_string argument in a span element with an action_message class.
Renders the message_string argument in a span element with an action_error_message class.
Renders a submit button in a span with the name set to the event_id argument, and the
value set to the label argument.
Renders the standard_button fragment.
Renders the standard_button fragment.
Renders the standard_button fragment.
Empty by default.
share/skin/base/layout/action.tt
Extends the layout set of the same name in the parent skin.
The following layouts are provided:
Adds a br element after the original container fragment.
Adds a br element after the original message_layout fragment.
See Reaction::Class for authors.
See Reaction::Class for the license.
| Reaction documentation | Contained in the Reaction distribution. |
package Reaction::UI::Widget::Action; use Reaction::UI::WidgetClass; use namespace::clean -except => [ qw(meta) ]; extends 'Reaction::UI::Widget::Object::Mutable'; after fragment widget { my $vp = $_{viewport}; arg 'method' => $vp->method; arg 'form_id' => $vp->location; arg 'action' => $vp->has_action ? $vp->action : ''; }; implements fragment message { return unless $_{viewport}->has_message; arg message_string => $_{viewport}->message; render 'message_layout'; }; implements fragment error_message { return unless $_{viewport}->has_error_message; arg message_string => $_{viewport}->error_message; render 'error_message_layout'; }; implements fragment ok_button_fragment { if (grep { $_ eq 'ok' } $_{viewport}->accept_events) { arg 'event_id' => event_id 'ok'; arg 'label' => localized $_{viewport}->ok_label; render 'ok_button'; } }; implements fragment apply_button_fragment { if (grep { $_ eq 'apply' } $_{viewport}->accept_events) { arg 'event_id' => event_id 'apply'; arg 'label' => localized $_{viewport}->apply_label; render 'apply_button'; } }; implements fragment cancel_button_fragment { if (grep { $_ eq 'close' } $_{viewport}->accept_events) { arg 'event_id' => event_id 'close'; arg 'label' => localized $_{viewport}->close_label; render 'cancel_button'; } }; implements fragment maybe_inner { if( my $inner = $_{viewport}->inner ){ arg '_' => $inner; render 'viewport'; } }; __PACKAGE__->meta->make_immutable; 1; __END__;