[html-formfu] get_element method
Dermot
paikkos at googlemail.com
Tue Sep 16 11:44:31 BST 2008
Hi,
I cannot get the get_element method to work on my installation.
Catalyst::Controller::HTML::FormFu
my $select = $form->get_element({type => 'Select'}); # There
is only one select element in my yml form
$c->log->debug("Select=",$select);
$select->options(\@roles);
Produces this:
[debug] Select=
[error] Caught exception in Motion::Controller::Users->add "Can't call
method "options" on an undefined value at
/var/www/MyApp/script/../lib/MyApp/Controller/Users.pm line 79."
I have had this problem in a few different controllers in my Cat app.
What I have been doing is
my $select = $form->get_all_elements({type => 'Select'});
$c->log->debug("Select=",join ' ', $select->[0]);
$select->[0]->options(\@roles);
I guess I might need to try this in a CGI environment to debug it
further but I was wondering if anyone else has experienced this?
Thanx,
Dp.
More information about the HTML-FormFu
mailing list