my @res;
for my $object (@$items) {
- $stringify ||= $object->stringify_column;
+ $stringify ||= $object->stringify_column if ($object->can('stringify_column'));
my $id = $object->id;
my $opt = HTML::Element->new("option", value => $id);
$id =~ s/^0*//; # leading zeros no good in hash key
my $selected = $args->{selected} || {};
my @res;
my $class = $args->{class} || '';
- my $stringify = $args->{stringify} || $self->stringify_column;
+ my $stringify = $args->{stringify};
+ $stringify ||= $self->stringify_column if ($self->can('stringify_column'));
for my $item (@$items) {
my @pks; # for future multiple key support
push @pks, shift @$item foreach $class->columns('Primary');
my $selected = $args->{selected} || {};
my $pk = eval {$args->{class}->primary_column} || 'id';
my $fclass = $args->{class} || '';
- my $stringify = $args->{stringify} || $self->stringify_column;
+ my $stringify = $args->{stringify};
+ $stringify ||= $self->stringify_column if ( $self->can('stringify_column') );
my @res;
for my $item (@$items) {
my $val = defined $item->{$pk} ? $item->{$pk} : '';
$content = $item->{$stringify};
} else {
$content = join(' ', map {$item->{$_} } keys %$item);
- }
+ }
+
$opt->push_content( $content );
push @res, $opt;
}