branching
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / HiddenArray.pm
1 package Reaction::UI::ViewPort::Field::HiddenArray;
2
3 use Reaction::Class;
4
5 class HiddenArray is 'Reaction::UI::ViewPort::Field', which {
6
7   has '+value' => (isa => 'ArrayRef');
8   
9   around value => sub {
10     my $orig = shift;
11     my $self = shift;
12     if (@_) {
13       $orig->($self, (ref $_[0] eq 'ARRAY' ? $_[0] : [ $_[0] ]));
14       $self->sync_to_action;
15     } else {
16       $orig->($self);
17     }
18   };
19
20 };
21
22 1;  
23
24 =head1 NAME
25
26 Reaction::UI::ViewPort::Field::HiddenArray
27
28 =head1 DESCRIPTION
29
30 =head1 SEE ALSO
31
32 =head2 L<Reaction::UI::ViewPort::Field>
33
34 =head1 AUTHORS
35
36 See L<Reaction::Class> for authors.
37
38 =head1 LICENSE
39
40 See L<Reaction::Class> for the license.
41
42 =cut