[html-formfu] Programmatically changing a
HTML::FormFu::Element::Select option list
Scott Wall-gmail
tswall at gmail.com
Wed Oct 31 00:56:23 GMT 2007
I apologize if the answer to the question is obvious as I am just
acquainting myself with the Catalyst framework and Perl in general. I am a
java and ruby developer by background. How does one programmatically access
the list of options in a HTML::FormFu::Element::Select option list? As a
form is loaded via $form->load_config_file( $my_yml_file ) I'd like to set a
given option as selected based on data pulled from the database, but the
option list appears to be a nested arrayref that I can't seem to manipulate.
I have done this with other elements, for example
HTML::FormFu::Element::Text elements as follows:
my $textbox_elements =3D $form->get_elements({type =3D> 'Text' });
foreach my $tb (@$textbox_elements) {
my $element_name =3D $tb->{name};
my $sf =3D get_some_object_from_the_database();
$tb->attributes->{value} =3D $sf->finding_value;
}
Any assistance would be wonderful.
Regards,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20071030/61=
7c1263/attachment-0001.htm
More information about the HTML-FormFu
mailing list