Commit | Line | Data |
8f19d042 |
1 | package Reaction::UI::Widget::Field; |
2 | |
3 | use Reaction::UI::WidgetClass; |
4 | |
5 | class Field, which { |
6 | |
664d660c |
7 | before fragment widget { |
664d660c |
8 | if ($_{viewport}->can('value_string')) { |
9 | arg 'field_value' => $_{viewport}->value_string; |
2f670e13 |
10 | } else { |
3fad510b |
11 | arg 'field_value' => ''; #$_{viewport}->value; |
664d660c |
12 | } |
13 | }; |
14 | |
cc44a337 |
15 | implements fragment label_fragment { |
664d660c |
16 | if (my $label = $_{viewport}->label) { |
17 | arg label => $label; |
18 | render 'label'; |
19 | } |
20 | }; |
8f19d042 |
21 | |
8f19d042 |
22 | }; |
23 | |
24 | 1; |
25 | |
6ab43711 |
26 | __END__; |
27 | |
5a1a893e |
28 | =head1 NAME |
29 | |
30 | Reaction::UI::Widget::Field |
31 | |
32 | =head1 DESCRIPTION |
33 | |
5a1a893e |
34 | =head1 FRAGMENTS |
35 | |
36 | =head2 widget |
37 | |
38 | Additional variables available in topic hash: "viewport", "id", "name". |
39 | |
40 | Renders "label","field" and "message" |
41 | |
42 | =head2 field |
43 | |
44 | C<content> will contain the value, if any, of the field. |
45 | |
46 | =head2 label |
47 | |
48 | C<content> will contain the label, if any, of the field. |
49 | |
50 | =head2 message |
51 | |
52 | C<content> will contain the message, if any, of the field. |
53 | |
54 | =head1 AUTHORS |
55 | |
56 | See L<Reaction::Class> for authors. |
57 | |
58 | =head1 LICENSE |
59 | |
60 | See L<Reaction::Class> for the license. |
61 | |
62 | =cut |