projects
/
catagits/Reaction.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
049d223
)
fixed hidden array viewport value_string attribute
edenc [Fri, 4 Sep 2009 03:48:44 +0000 (
03:48
+0000)]
lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
patch
|
blob
|
blame
|
history
lib/Reaction/UI/Widget/Field/Mutable/HiddenArray.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
b/lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
index
6f5129c
..
4cc556c
100644
(file)
--- a/
lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
+++ b/
lib/Reaction/UI/ViewPort/Field/Mutable/Array.pm
@@
-14,8
+14,11
@@
around value => sub {
my $value = defined $_[0] ? $_[0] : [];
$orig->($self, (ref $value eq 'ARRAY' ? $value : [ $value ]));
};
-__PACKAGE__->meta->make_immutable;
+# value_string doesn't make sense in an Array field
+override _value_string_from_value => sub { shift->_empty_string_value };
+
+__PACKAGE__->meta->make_immutable;
1;
diff --git
a/lib/Reaction/UI/Widget/Field/Mutable/HiddenArray.pm
b/lib/Reaction/UI/Widget/Field/Mutable/HiddenArray.pm
index
0b8cce7
..
e4e1c10
100644
(file)
--- a/
lib/Reaction/UI/Widget/Field/Mutable/HiddenArray.pm
+++ b/
lib/Reaction/UI/Widget/Field/Mutable/HiddenArray.pm
@@
-6,8
+6,6
@@
use Reaction::UI::WidgetClass;
use namespace::clean -except => [ qw(meta) ];
extends 'Reaction::UI::Widget::Field::Mutable';
-
-
implements fragment hidden_list {
render hidden_field => over $_{viewport}->value;
};