[html-formfu] position element not found

Gabor HALASZ halasz.g at freemail.hu
Tue Jan 17 21:38:25 GMT 2012


On 1/10/2012 7:48 PM, Gabor HALASZ wrote:

> $position = $c->stash->{form}->get_all_element({ type => 'File', });
>
> $position->parent->insert_after( $c->stash->{form}->element( {
> name => $productId,
> src => $c->uri_for( '/api/getproducticon/' . $productId ),
> type => 'Image',
> } ), $position );
>
> Any idea?

Ok, I found the answer in t/block_insert_before.t :) The new element 
must derivated from the parent object, so next code :

$position->parent->insert_after(
  $position->parent->element( {
   name => $productId,
   src => $c->uri_for( '/api/getproducticon/' . $productId ),
   type => 'Image',
  } ),
  $position
);

wokrs correctly. I think, this need to be documented in the cookbook and 
man pages.



More information about the HTML-FormFu mailing list