[html-formfu] More questions about selects :)

Andreas Marienborg omega at palle.net
Wed Feb 13 08:19:14 GMT 2008


On Feb 12, 2008, at 11:14 AM, Carl Franks wrote:

> On 11/02/2008, Andreas Marienborg <omega at palle.net> wrote:
>> Hey again :p
>>
>> empty_first is nice, but I was wondering if its possible to have a
>> label for it? specificaly label_loc :p
>
> That sounds reasonable.
>
> It'll need to be added to Element/_Group.pm
> Import mk_output_accessors() from HTML::FormFu::Attribute
> then do:
>    __PACKAGE__->mk_output_accessors(qw/ empty_first_label /);
>

So far so good. This now works.

> And it'll also automatically create methods for
> empty_first_label_loc() and empty_first_label_xml()
>

Ahh, the magic is endless :p calling $self->empty_first_label gives me  
the translated one if there is one it seems :) I was trying to check  
for a set one and translate myself, but it just works (tm).

> The more difficult bit will be searching through _Group.pm for all
> uses of empty_first and making sure it's handled properly.
>

There doesn't seem to be any tests for empty_first either? atleast  
grepping t/ doesn't show anything.

> And tests too, of course :p
>

I'll add some tests in elements/select_empty_first_label.t


I attach a patch here, for review before I commit, just to make sure  
the code-style is ok, tests are correctly done etc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: empty_first_label.diff
Type: application/octet-stream
Size: 4759 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20080213/a7bd630d/empty_first_label-0001.obj
-------------- next part --------------



- andreas



More information about the HTML-FormFu mailing list