changed DateTime type constant to DateTimeObject
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field.pm
index 1594c06..f6da895 100644 (file)
@@ -6,7 +6,7 @@ use aliased 'Reaction::Meta::InterfaceModel::Object::ParameterAttribute';
 
 class Field is 'Reaction::UI::ViewPort', which {
 
-  has value        => (is => 'rw', lazy_build => 1, clearer => 'clear_value');
+  has value        => (is => 'rw', lazy_build => 1);
   has name         => (is => 'rw', isa => 'Str', lazy_build => 1);
   has label        => (is => 'rw', isa => 'Str', lazy_build => 1);
   has value_string => (is => 'rw', isa => 'Str', lazy_build => 1);
@@ -14,15 +14,8 @@ class Field is 'Reaction::UI::ViewPort', which {
   has model     => (is => 'ro', isa => Object,             required => 1);
   has attribute => (is => 'ro', isa => ParameterAttribute, required => 1);
 
-  implements adopt_value => as {};
-
   implements _build_name => as { shift->attribute->name };
 
-  implements _build_value_string => as {
-    my($self) = @_;
-    return $self->has_value? $self->value : '';
-  };
-
   implements _build_label => as {
     join(' ', map { ucfirst } split('_', shift->name));
   };
@@ -64,6 +57,10 @@ class Field is 'Reaction::UI::ViewPort', which {
 
   implements _empty_string_value => as { '' };
 
+  implements value_is_required => as {
+    shift->attribute->is_required;
+  };
+
 };
 
 1;