grid is starting to work, actions and view to go
groditi [Wed, 2 Jan 2008 20:44:09 +0000 (20:44 +0000)]
lib/Reaction/UI/ViewPort/Collection/Grid/Member.pm
lib/Reaction/UI/ViewPort/Field.pm
lib/Reaction/UI/ViewPort/Object.pm
lib/Reaction/UI/Widget/Field/Number.pm
lib/Reaction/UI/Widget/Object.pm
share/skin/default/layout/field.tt

index c37e10e..bbe1c49 100644 (file)
@@ -5,35 +5,35 @@ use Reaction::Class;
 class Member is 'Reaction::UI::ViewPort::Object', which {
 
   around _build_fields_for_type_Num => sub {
-    $_[0]->(@_[1..3], { layout => 'value/number', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/number', %{ $_[3] || {}} })
   };
 
   around _build_fields_for_type_Int => sub {
-    $_[0]->(@_[1..3], { layout => 'value/number', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/number', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_Bool => sub {
-    $_[0]->(@_[1..3], { layout => 'value/boolean', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/boolean', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_Enum => sub {
-    $_[0]->(@_[1..3], { layout => 'value/string', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/string', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_Str => sub {
-    $_[0]->(@_[1..3], { layout => 'value/string', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/string', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_SimpleStr => sub {
-    $_[0]->(@_[1..3], { layout => 'value/string', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/string', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_Reaction_InterfaceModel_Object => sub {
-    $_[0]->(@_[1..3], { layout => 'value/string', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/string', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_DateTime => sub {
-    $_[0]->(@_[1..3], { layout => 'value/date_time', %{ $_[4] } })
+    $_[0]->(@_[1,2], { layout => 'value/date_time', %{ $_[3] || {} } })
   };
 
   around _build_fields_for_type_Password => sub { return };
index d8d504a..c374eb8 100644 (file)
@@ -29,7 +29,9 @@ class Field is 'Reaction::UI::ViewPort', which {
     my $reader = $self->attribute->get_read_method;
     my $predicate = $self->attribute->predicate;
     #this is bound to blow the fuck if !model->$predicate what to do?
-    return $self->model->$reader if (!$predicate || $self->model->$predicate);
+    return $self->model->$reader ; #if (!$predicate || $self->model->$predicate);
+
+    print STDERR "weird!\n";
     return;
   };
 
index 8a40fbf..326394f 100644 (file)
@@ -42,10 +42,10 @@ class Object is 'Reaction::UI::ViewPort', which {
     my $obj  = $self->model;
     my $args = $self->has_field_args ? $self->field_args : {};
     my @fields;
-    for my $field_name (@{ $self->field_order }) {
+    for my $field_name (@{ $self->ordered_fields }) {
       my $attr = $obj->meta->find_attribute_by_name($field_name);
       my $meth = $self->builder_cache->{$field_name} ||= $self->get_builder_for($attr);
-      my $field = $self->$meth($obj, $attr, ($args->{$field_name} || {}));
+      my $field = $self->$meth($attr, ($args->{$field_name} || {}));
       push(@fields, $field) if $field;
     }
     return \@fields;
@@ -57,7 +57,7 @@ class Object is 'Reaction::UI::ViewPort', which {
     #treat _$field_name as private and exclude fields with no reader
     my @names = grep { $_ !~ /^_/ && !exists($excluded{$_})} map { $_->name }
       grep { defined $_->get_read_method } $self->model->meta->parameter_attributes;
-    return $self->sort_by_spec($self->field_order, \@names);
+    return $self->sort_by_spec($self->field_order || [], \@names);
   };
 
   override child_event_sinks => sub {
index f80144e..0691768 100644 (file)
@@ -12,11 +12,11 @@ __END__;
 
 =head1 NAME
 
-Reaction::UI::Widget::DisplayField::Numberx
+Reaction::UI::Widget::DisplayField::Number
 
 =head1 DESCRIPTION
 
-See L<Reaction::UI::Widget::DisplayField>
+See L<Reaction::UI::Widget::Display>
 
 =head1 AUTHORS
 
index 68b47f3..505d00d 100644 (file)
@@ -5,7 +5,7 @@ use Reaction::UI::WidgetClass;
 class Object, which {
 
   implements fragment field_list {
-    render field => over $_{viewport}->ordered_fields;
+    render field => over $_{viewport}->fields;
   };
 
   implements fragment field {
index d531087..937ba51 100644 (file)
@@ -9,6 +9,6 @@
 
 =for layout value_layout
 
-[% value %]
+[% field_value %]
 
 =cut