more Widget updates. this breaks old-style templates, also changed how VPs behave...
[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   widget renders [ qw/label list item/ =>  { viewport => func(self => 'viewport') } ];
7   label  renders [ string { $_{viewport}->label } ];
8   list   renders [ item over func('viewport', 'value_names') ];
9   item   renders [ string { $_{_} } ];
10 };
11
12 1;
13
14 __END__;
15
16 =for layout widget
17
18 [% label %]
19 [% list  %]
20
21 =for layout label
22
23 <strong > [ % content %]: </strong>
24
25 =for layout list
26
27 <ul>
28 [% item %]
29 </ul>
30
31 =for layout item
32
33 <li>[% content %]</li>
34
35 =cut