Subject: | Missing options in select |
Hi,
I've created a multiple select field, defined like this:
--
companies:
label: Companies affected
type: select
multiple: 1
--
When I add options they don't appear in the select. As a test case I've
added them like this in the controller:
--
$self->formbuilder->field('companies', options => { 1 => 'Test' });
--
The option doesn't appear and I see this in the debug log (when [%
FormBuilder.render %] is evaluated in the template);
--
[CGI::FormBuilder::Template::Builtin::prepare] (debug2) render:
attacking normal field 'companies'
[CGI::FormBuilder::Field::tag_value] (debug2) companies: called
$field->tag_value
[CGI::FormBuilder::Field::tag_value] (debug2) companies: sticky && ! force
[CGI::FormBuilder::Field::cgi_value] (debug2) companies: called
$field->cgi_value
[CGI::FormBuilder::Field::tag_value] (debug2) no cgi found, returning
def_value
[CGI::FormBuilder::Field::def_value] (debug2) companies: called
$field->def_value
[CGI::FormBuilder::Field::def_value] (debug2) companies: def value = ()
[CGI::FormBuilder::Field::inflate_value] (debug2) companies: called
$field->inflate_value
[CGI::FormBuilder::Field::select::tag] (debug2) my() = $field->options
[CGI::FormBuilder::Field::select::tag] (debug2) companies: generating
select input type
[FormBuilder] Warning: companies: No options specified for 'select'
field at /usr/share/perl5/CGI/FormBuilder/Template/Builtin.pm line 193
[CGI::FormBuilder::Field::select::tag] (debug2) companies: rendering
options: ()
[CGI::FormBuilder::Field::select::tag] (debug2) companies: generated tag
= <select id="companies" multiple="multiple" name="companies">
</select>
--
However if I examine the value returned from $self->formbuilder->render
in the controller after added the option it appears correctly. Therefore
it seems like a bug in this module.
FWIW, perl version is 5.8.8 and Catalyst is 5.7011.
Any help appreciated :)
TIA,
Peter Spikings.