widget documentation
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Mutable / HiddenArray.pm
1 package Reaction::UI::Widget::Field::Mutable::HiddenArray;
2
3 use Reaction::UI::WidgetClass;
4
5 #move this to a normal list and let the hidden part be decided by the template..
6 use namespace::clean -except => [ qw(meta) ];
7 extends 'Reaction::UI::Widget::Field::Mutable';
8
9
10
11 implements fragment hidden_list {
12   render hidden_field => over $_{viewport}->value;
13 };
14
15 implements fragment hidden_field {
16   arg field_value => $_;
17 };
18
19 __PACKAGE__->meta->make_immutable;
20
21
22 1;
23
24 __END__;
25
26 =head1 NAME
27
28 Reaction::UI::Widget::Field::Mutable::HiddenArray
29
30 =head1 DESCRIPTION
31
32 See L<Reaction::UI::Widget::Field::Mutable>. This renders a list of values
33 as a series of hidden fields to transport them across forms.
34
35 =head1 FRAGMENTS
36
37 =head2 hidden_list
38
39 Renders C<hidden_field> over the array reference stored in the viewpoint's
40 C<value>.
41
42 =head2 hidden_field
43
44 Sets the C<field_value> argument to the current topic argument C<_>.
45
46 =head2 field
47
48 renders fragment C<item> over the values of 'value' arrayref
49
50 =head2 item
51
52 C<content> is $_{_} / $_ (current item in the 'value' array)
53
54 =head1 LAYOUT SETS
55
56 =head2 base
57
58   share/skin/base/layout/field/mutable/hidden_array.tt
59
60 Provides a C<hidden_field> layout that renders a hidden input element.
61
62 =head1 AUTHORS
63
64 See L<Reaction::Class> for authors.
65
66 =head1 LICENSE
67
68 See L<Reaction::Class> for the license.
69
70 =cut