bcac990247daeb047bad3d7e9c3590a50f0c2de0
[catagits/Reaction.git] / lib / Reaction / UI / Widget / DisplayField / Collection.pm
1 package Reaction::UI::Widget::DisplayField::Collection;
2
3 use Reaction::UI::WidgetClass;
4
5 class Collection, which {
6   fragment widget [ qw/label list/ ];
7   fragment label  [ string { $_{viewport}->label } ];
8   fragment list   [ item => over func('viewport', 'value_names') ];
9   fragment item   [ string { $_ } ];
10 };
11
12 1;
13
14 __END__;
15
16
17 =head1 NAME
18
19 Reaction::UI::Widget::DisplayField::Collection
20
21 =head1 DESCRIPTION
22
23 =head1 FRAGMENTS
24
25 =head2 widget
26
27 renders C<label> and C<list> passing additional variable "viewport"
28
29 =head2 label
30
31 C<content> contains the viewport's label
32
33 =head2 list
34
35 renders fragment item over the viewport's C<value_names>
36
37 =head2 item
38
39 C<content> contains the value of the current item ($_ / $_{_})
40
41 =head1 AUTHORS
42
43 See L<Reaction::Class> for authors.
44
45 =head1 LICENSE
46
47 See L<Reaction::Class> for the license.
48
49 =cut