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