Good morning,

I'm getting an exception when using insert_after to move a newly created element. I'm using the following code to create/insert the new element.

my $new_elem = $form->element($trait_kids->formfu); # $trait->formfu is hashref
my $after_this = $form->get_field({name => 'my_postcode'});

### $new_elem->name --> 'trait_kids'
### $after_this->name --> 'my_postcode'

### ref new_elem --> 'HTML::FormFu::Element::Select'
### ref after_this --> 'HTML::FormFu::Element::Text'

$form->insert_after($new_elem, $after_this);
# Caught exception in MyApp::Controller::Profiles->edit "position element not found at ....


If I comment out the insert_after line, then the form displays with the new element added at the end. And both $new_elem & $after_this seem to be valid elements.

Can anyone suggest how I should debug this? Is it possible this could be a regression in .05001? I'm pretty sure this was working for me last week, but I just started using insert_after so I could be wrong about it working previously.

Thanks,
Charlie

--
   Charlie Garrison  <garri...@zeta.org.au>
   PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to