[Catalyst] HTML::Widget - AllOrNone with Select and empty values

Adam Sjøgren adsj at novozymes.com
Fri May 5 16:08:12 CEST 2006


Consider this widget-definition:

 my $widget=HTML::Widget->new('widget')->method('get')->action('/');
 $widget->element('Select', 'thing')->options(''=>'Empty', '1'=>'One', '2'=>'Two');
 $widget->element('Textfield', 'other');
 $widget->constraint('AllOrNone', qw(thing other));

What is to be expected when the query is (there, but) empty?

My guess would be that the constraint is fulfilled - none of the
fields are filled in, right?

The small attached test-script shows otherwise:

 $ ./allornone-select-1.07.pl
 Use of uninitialized value in exists at /usr/share/perl5/HTML/Widget/Constraint/In.pm line 21.
 -  -   - expecting   valid, got: invalid
        - expecting   valid, got: valid
 $ 

Bug or feature?


  Best regards,

    Adam

-- 
                                                          Adam Sjøgren
                                                    adsj at novozymes.com

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: allornone-select-1.07.pl
Url: http://lists.rawmode.org/pipermail/catalyst/attachments/20060505/da0170e9/attachment.diff 


More information about the Catalyst mailing list