Commit | Line | Data |
8f19d042 |
1 | package Reaction::UI::Widget::Field; |
2 | |
3 | use Reaction::UI::WidgetClass; |
4 | |
5 | class Field, which { |
6 | |
6bc27bd3 |
7 | fragment widget [qw/label field message/ |
097e8442 |
8 | => { id => sub { $_{viewport}->event_id_for('value') }, |
9 | name => sub { $_{viewport}->event_id_for('value') }, |
8f19d042 |
10 | ]; |
11 | |
6bc27bd3 |
12 | fragment field [ string { $_{viewport}->value }, ]; |
a5200252 |
13 | |
6bc27bd3 |
14 | fragment label [ string { $_{viewport}->label }, ]; |
15 | fragment message [ string { $_{viewport}->message }, ]; |
8f19d042 |
16 | |
8f19d042 |
17 | }; |
18 | |
19 | 1; |
20 | |
6ab43711 |
21 | __END__; |
22 | |
5a1a893e |
23 | =head1 NAME |
24 | |
25 | Reaction::UI::Widget::Field |
26 | |
27 | =head1 DESCRIPTION |
28 | |
29 | =head1 ATTRIBUTES |
30 | |
31 | =head2 id |
32 | |
33 | Str, lazy builds. |
34 | |
35 | =head2 name |
36 | |
37 | Str, lazy builds. |
38 | |
39 | =head1 METHODS |
40 | |
89939ff9 |
41 | =head2 _build_id |
5a1a893e |
42 | |
43 | Returns the viewport's C<event_id_for('value')> |
44 | |
89939ff9 |
45 | =head2 _build_name |
5a1a893e |
46 | |
47 | Returns the viewport's C<event_id_for('value')> |
48 | |
49 | =head1 FRAGMENTS |
50 | |
51 | =head2 widget |
52 | |
53 | Additional variables available in topic hash: "viewport", "id", "name". |
54 | |
55 | Renders "label","field" and "message" |
56 | |
57 | =head2 field |
58 | |
59 | C<content> will contain the value, if any, of the field. |
60 | |
61 | =head2 label |
62 | |
63 | C<content> will contain the label, if any, of the field. |
64 | |
65 | =head2 message |
66 | |
67 | C<content> will contain the message, if any, of the field. |
68 | |
69 | =head1 AUTHORS |
70 | |
71 | See L<Reaction::Class> for authors. |
72 | |
73 | =head1 LICENSE |
74 | |
75 | See L<Reaction::Class> for the license. |
76 | |
77 | =cut |