Skip to content

Commit

Permalink
add a bit of doc about handling DBIC new results & 'use_default_over_…
Browse files Browse the repository at this point in the history
…obj'
  • Loading branch information
gshank committed Mar 9, 2014
1 parent e07fe5e commit a024c02
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/HTML/FormHandler/Manual/Defaults.pod
Expand Up @@ -54,6 +54,17 @@ flag 'use_defaults_over_obj'.

$form->process( item => $empty_row, use_defaults_over_obj => 1 );

If you always want new DBIC results to be ignored, you could set the flag in
a base form method:

sub set_active {
my $self = shift;
$self->next::method;
if ( $self->item and ! $self->item->in_storage ) {
$self->use_defaults_over_obj(1);
}
}

You could also pass in another object or hashref in the 'init_object' attribute,
and set the 'use_init_obj_over_item' flag:

Expand Down

0 comments on commit a024c02

Please sign in to comment.