On 26/02/07, Mario Minati <[EMAIL PROTECTED]> wrote:
mk_output_accessors in HTML::FormFu::Accessor: my $sub = sub { my $self = shift; if (@_) { $self->{$name} = ( @_ == 1 ) ? output_value( $_[0] ) : [ map { output_value( $_[0] ) } @_ ]; return $self; } return $self->{$name}; }; In my opinion it should be map { output_value( $_ ) } @_ instead of map { output_value( $_[0] ) } @_
You're right. I've actually changed it to just: if (@_) { $self->{$name} = output_value( $_[0] ); return $self; } As passing multiple values would probably just cause TT to die anyway.
I just had another idea. Would it be comfortable for the user if we could provide an extra message for constraints (maybe also filters) which is show like a comment. E. g. we provide a message like 'This field is required.' right away, instead of complaining afterwards, that we didn't get enough data. An alternativ would be to put an additional class in the container like 'constraint_required filter_whitespace', that would give the opportunity to do some color or icon coding in css.
I'd thought of adding constraints as classnames, but it unfortunately doesn't buy much, as IE doesn't support the content{} property (and it can't contain html anyway). I wonder whether this belongs in the 'field' template? [% IF self.has_xml_attribute( 'class', 'constraint_required' ) %] <b>This field is required</b> [% END %] (the has_xml_attribute() method isn't currently exported to TT, but could be) Carl _______________________________________________ Html-widget mailing list Html-widget@lists.rawmode.org http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget