made hidden array field use the value event instead of value_string
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Mutable / HiddenArray.pm
CommitLineData
2f670e13 1package Reaction::UI::Widget::Field::Mutable::HiddenArray;
8f19d042 2
3use Reaction::UI::WidgetClass;
4
2f670e13 5#move this to a normal list and let the hidden part be decided by the template..
bae75bee 6use namespace::clean -except => [ qw(meta) ];
7extends 'Reaction::UI::Widget::Field::Mutable';
8f19d042 8
bae75bee 9implements fragment hidden_list {
10 render hidden_field => over $_{viewport}->value;
8f19d042 11};
12
bae75bee 13implements 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 241;
25
6ab43711 26__END__;
8f19d042 27
5a1a893e 28=head1 NAME
8f19d042 29
87b8ba85 30Reaction::UI::Widget::Field::Mutable::HiddenArray
8f19d042 31
5a1a893e 32=head1 DESCRIPTION
8f19d042 33
f9b32c83 34See L<Reaction::UI::Widget::Field::Mutable>. This renders a list of values
35as a series of hidden fields to transport them across forms.
8f19d042 36
5a1a893e 37=head1 FRAGMENTS
8f19d042 38
f9b32c83 39=head2 hidden_list
40
41Renders C<hidden_field> over the array reference stored in the viewpoint's
42C<value>.
43
44=head2 hidden_field
45
46Sets the C<field_value> argument to the current topic argument C<_>.
47
5a1a893e 48=head2 field
8f19d042 49
5a1a893e 50renders fragment C<item> over the values of 'value' arrayref
8f19d042 51
5a1a893e 52=head2 item
53
54C<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
62Provides a C<hidden_field> layout that renders a hidden input element.
63
5a1a893e 64=head1 AUTHORS
65
66See L<Reaction::Class> for authors.
67
68=head1 LICENSE
69
70See L<Reaction::Class> for the license.
8f19d042 71
72=cut