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