diff options
author | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-01-09 00:22:00 +0000 |
---|---|---|
committer | groditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-01-09 00:22:00 +0000 |
commit | eb52e5952c914864f58a122b7587c7383844a790 (patch) | |
tree | b8d2d780c7ea731cad2a5e19cc879f14c2bf0fd2 | |
parent | e0a6ddb2fad8960edbc1104cdb7c909acf5b7b00 (diff) | |
download | reaction-eb52e5952c914864f58a122b7587c7383844a790.tar.gz reaction-eb52e5952c914864f58a122b7587c7383844a790.zip |
move the error to the action
-rw-r--r-- | Changes | 5 | ||||
-rw-r--r-- | lib/Reaction/InterfaceModel/Action.pm | 5 | ||||
-rw-r--r-- | lib/Reaction/UI/ViewPort/Action.pm | 2 |
3 files changed, 9 insertions, 3 deletions
@@ -2,8 +2,9 @@ Revision history for Reaction 0.002000 - Stop using ACCEPT_CONTEXT, use InstancePerContext instead - up the dependency version on Devel::Declare to 003004 - - Updated ViewPort::Action to support action-wide messages and - error messages via attributes message and error_message. + - Added an error_message attribute to IM::Action + - Updated ViewPort::Action to support action-wide messages and error + messages via attribute message and model's error_message attribute. - Updated templates and widget to match this - Added an example to ComponentUI diff --git a/lib/Reaction/InterfaceModel/Action.pm b/lib/Reaction/InterfaceModel/Action.pm index 12234ec..06ab55a 100644 --- a/lib/Reaction/InterfaceModel/Action.pm +++ b/lib/Reaction/InterfaceModel/Action.pm @@ -8,6 +8,11 @@ use Reaction::Class; use namespace::clean -except => [ qw(meta) ]; +has error_message => ( + is => 'rw', + isa => 'Str', + metaclass => 'Reaction::Meta::Attribute' +); has target_model => ( is => 'ro', required => 1, diff --git a/lib/Reaction/UI/ViewPort/Action.pm b/lib/Reaction/UI/ViewPort/Action.pm index 97f5a44..b2af674 100644 --- a/lib/Reaction/UI/ViewPort/Action.pm +++ b/lib/Reaction/UI/ViewPort/Action.pm @@ -11,7 +11,7 @@ extends 'Reaction::UI::ViewPort::Object::Mutable'; with 'Reaction::UI::ViewPort::Action::Role::OK'; has message => (is => 'rw', isa => Str); -has error_message => (is => 'rw', isa => Str); +has '+model' => (handles => [qw/error_message has_error_message/]); #this has to fucking go. it BLOWS. has method => ( |