[html-formfu] Label element

Moritz Onken onken at houseofdesign.de
Fri Mar 20 13:02:30 GMT 2009


Hi Carl,

comments are in-line.

Am 20.03.2009 um 12:26 schrieb Carl Franks:

> Moritz,
>
> I see a Label element appeared in svn at some point! ;)
> There's a few problems with it...
>
> The tests fail when run with ENV var HTML_FORMFU_RENDER_METHOD=tt
> This is because there's no TT template for it in share/templates/tt/ 
> xhtml

I added label_tag (since label already existed) and added some code.
Unfortunately I cannot access self.tag in there. Any ideas?

>
> There should be a link to it from the HTML/Element.pm pod section
> "OTHER CORE ELEMENTS"

done

>
> Someone could still submit a name=value pair for it.
> The model_config->{read_only} = 1 handles that for Model-DBIC, but it
> could cause problems for other things.
> I'm not sure it should really inherit from Element/_Field - though
> dealing with that would be troublesome.
> I'd suggest it should at least do something like:
>
>    sub process_input {
>        my ( $self, $input ) = @_;
>
>        my $form = $self->form;
>        my $name = $self->nested_name;
>
>        if ( $form->submitted && $form->nested_hash_key_exists(
> $input, $name ) ) {
>            $form->delete_nested_hash_value( $input, $name );
>        }
>
>        return;
>    }

Ok, I added those lines, but I have no idea what they do actually :-)
I'd like to write a test for that, but I don't know what I should test.
Label inherits from _Field because I thought that Model::DBIC only
fills in those elements.

>
> These will need dealt with before Label.pm can be pushed to cpan.
>
> I'd also prefer it if the test file followed the same conventions as  
> others:
> Have the form config in a separate config file - t/elements/label.yml
> .t files shouldn't have a shbang line
> and should use strict + warnings

done.

Committed revision 1380.


Those FormatNumber modules should still be skipped. Format::Number still
fails on many system which base on BSD or are 64bit.


cheers,

Moritz




More information about the HTML-FormFu mailing list