aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Action.pm
diff options
context:
space:
mode:
authorphaylon <phaylon@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-02-09 20:25:06 +0000
committerphaylon <phaylon@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2009-02-09 20:25:06 +0000
commit63bb30b44346800078dc638dcc484828d89c2ad4 (patch)
tree2fe675d2533d3674da13bcf6d8c9cf9af055156f /lib/Reaction/UI/ViewPort/Action.pm
parent443dd74308a626a47f069bbb962fabbbb9c2842a (diff)
downloadreaction-63bb30b44346800078dc638dcc484828d89c2ad4.tar.gz
reaction-63bb30b44346800078dc638dcc484828d89c2ad4.zip
documentation update, some api docs, overview and tutorial upto first DM and IM including CRUD
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Action.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Action.pm48
1 files changed, 47 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Action.pm b/lib/Reaction/UI/ViewPort/Action.pm
index b2af674..f883b92 100644
--- a/lib/Reaction/UI/ViewPort/Action.pm
+++ b/lib/Reaction/UI/ViewPort/Action.pm
@@ -68,10 +68,16 @@ __END__;
=head1 NAME
-Reaction::UI::ViewPort::Action
+Reaction::UI::ViewPort::Action - Provide user with a form with OK, Apply and Close.
=head1 SYNOPSIS
+ $controller->push_viewport('Reaction::UI::ViewPort::Action',
+ model => $interface_model_action,
+ field_order => [qw( firstname lastname )],
+ excluded_fields => [qw( password )],
+ );
+
=head1 DESCRIPTION
This subclass of L<Reaction::UI::ViewPort::Object::Mutable> is used for
@@ -79,6 +85,15 @@ rendering a complete form supporting Apply, Close and OK.
=head1 ATTRIBUTES
+=head2 message
+
+=head2 model
+
+Inherited from L<Reaction::UI::ViewPort::Object::Mutable>. Must be a
+L<Reaction::InterfaceModel::Action>.
+
+Also handles C<error_message> and C<has_error_message> methods.
+
=head2 method
post / get
@@ -91,10 +106,41 @@ Returns true if a field has been edited.
=head2 can_apply
+Returns true if no field C<needs_sync> and the L</model> C<can_apply>.
+
=head2 do_apply
+Delegates to C<do_apply> on the L</model>, which is a
+L<Reaction::InterfaceModel::Action>.
+
=head2 sync_action_from_fields
+Firstly calls C<sync_to_action> on every L<Reaction::UI::ViewPort::Field::Mutable>
+in L<fields|Reaction::UI::ViewPort::Object/fields>. Then it calls C<sync_all> on
+the L<Reaction::InterfaceModel::Action> in L</model>. Next it will call
+C<sync_from_action> on every field to repopulate them from the L</model>.
+
+=head1 SUBCLASSING
+
+ package MyApp::UI::ViewPort::Action;
+ use Reaction::Class;
+ use MooseX::Types::Moose qw( Int );
+
+ use namespace::clean -except => 'meta';
+
+ extends 'Reaction::UI::ViewPort::Action';
+
+ has render_timestamp => (
+ is => 'ro',
+ isa => Int,
+ default => sub { time },
+ required => 1,
+ );
+
+ has '+field_order' => (default => sub {[qw( firstname lastname )]});
+
+ 1;
+
=head1 SEE ALSO
L<Reaction::UI::ViewPort>