diff options
-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 => ( |