fixed vestigial $ctx access
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / Mutable / HiddenArray.pm
CommitLineData
87b8ba85 1package Reaction::UI::ViewPort::Field::Mutable::HiddenArray;
7adfd53f 2
3use Reaction::Class;
4
81393881 5use namespace::clean -except => [ qw(meta) ];
6extends 'Reaction::UI::ViewPort::Field';
7
8with 'Reaction::UI::ViewPort::Field::Role::Mutable';
9
10has '+value' => (isa => 'ArrayRef');
11
12around value => sub {
13 my $orig = shift;
14 my $self = shift;
15 if (@_) {
16 #this hsould be done with coercions
17 $orig->($self, (ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ]));
18 $self->sync_to_action;
19 } else {
20 $orig->($self);
21 }
7adfd53f 22};
81393881 23sub _empty_value { [] };
24__PACKAGE__->meta->make_immutable;
25
7adfd53f 26
1734a92a 271;
7adfd53f 28
29=head1 NAME
30
87b8ba85 31Reaction::UI::ViewPort::Field::Mutable::HiddenArray
7adfd53f 32
33=head1 DESCRIPTION
34
35=head1 SEE ALSO
36
37=head2 L<Reaction::UI::ViewPort::Field>
38
39=head1 AUTHORS
40
41See L<Reaction::Class> for authors.
42
43=head1 LICENSE
44
45See L<Reaction::Class> for the license.
46
47=cut