From 36d54b146cfba17f5c7757eced453429ee31c780 Mon Sep 17 00:00:00 2001 From: groditi Date: Wed, 2 Jan 2008 22:57:32 +0000 Subject: choosemany is still broken (not applying changes) but everything else is looking better --- lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/Reaction/UI/ViewPort/Field/Mutable/ChooseMany.pm') 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||[]}; -- cgit v1.2.3-54-g00ecf