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