aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget/Field.pm
diff options
context:
space:
mode:
authorgroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2007-09-24 19:28:11 +0000
committergroditi <groditi@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2007-09-24 19:28:11 +0000
commit8f19d042dfa576c172e27ab79e3e193bcdbbbc22 (patch)
treebc0bec2a1cbd14c561dc93c2dd33e7a8d6377939 /lib/Reaction/UI/Widget/Field.pm
parent87018d74574763fb9a02779025ea1f50cf582c3b (diff)
downloadreaction-8f19d042dfa576c172e27ab79e3e193bcdbbbc22.tar.gz
reaction-8f19d042dfa576c172e27ab79e3e193bcdbbbc22.zip
start of new widgets for fields
Diffstat (limited to 'lib/Reaction/UI/Widget/Field.pm')
-rw-r--r--lib/Reaction/UI/Widget/Field.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Reaction/UI/Widget/Field.pm b/lib/Reaction/UI/Widget/Field.pm
new file mode 100644
index 0000000..f3caf3b
--- /dev/null
+++ b/lib/Reaction/UI/Widget/Field.pm
@@ -0,0 +1,27 @@
+package Reaction::UI::Widget::Field;
+
+use Reaction::UI::WidgetClass;
+
+class Field, which {
+
+ has id => (isa => 'Str', is => 'ro', lazy_build => 1);
+ has name => (isa => 'Str', is => 'ro', lazy_build => 1);
+
+ implements build_id => as { shift->viewport->event_id_for('value'); };
+ implements build_name => as { shift->viewport->event_id_for('value'); };
+
+ widget renders [qw/label field message/
+ => { id => func('self', 'id'),
+ name => func('self', 'name'),
+ viewport => func('self', 'viewport'), }
+ ];
+
+ label renders [ string { $_{viewport}->label }, ];
+ message renders [ string { $_{viewport}->message }, ];
+
+ field renders [ string { $_{viewport}->value }, ];
+
+};
+
+1;
+