aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-02 22:57:32 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-02 22:57:32 +0000
commit36d54b146cfba17f5c7757eced453429ee31c780 (patch)
treeb6b64cdf2c279bc7337c3dad7043f43e57e64de2 /lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm
parentc03f75a7322e8194591d2f8bd02fb3f83df8833f (diff)
downloadreaction-36d54b146cfba17f5c7757eced453429ee31c780.tar.gz
reaction-36d54b146cfba17f5c7757eced453429ee31c780.zip
choosemany is still broken (not applying changes) but everything else is looking better
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm
index f60d433..17cdf53 100644
--- a/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm
+++ b/lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm
@@ -14,13 +14,14 @@ class ChooseMany is 'Reaction::UI::ViewPort::Field', which {
does 'Reaction::UI::ViewPort::Field::Role::Mutable';
does 'Reaction::UI::ViewPort::Field::Role::Choices';
+
around value => sub {
my $orig = shift;
my $self = shift;
return $orig->($self) unless @_;
my $value = $listify->(shift);
$_ = $self->str_to_ident($_) for @$value;
- my $checked = $self->attribute->check_valid_value($self->action, $value);
+ my $checked = $self->attribute->check_valid_value($self->model, $value);
# i.e. fail if any of the values fail
confess "Not a valid set of values"
if (@$checked < @$value || grep { !defined($_) } @$checked);
@@ -32,6 +33,10 @@ class ChooseMany is 'Reaction::UI::ViewPort::Field', which {
return super() || [];
};
+ implements _build_value_string => as {
+ join ", ", @{ shift->current_value_choices }
+ };
+
implements is_current_value => as {
my ($self, $check_value) = @_;
my @our_values = @{$self->value||[]};