On 11/22/05, Jeff MacDonald <[EMAIL PROTECTED]> wrote:
> Do you folks have a method to easily populate a FillInForm object
> [well query object more accuratly i guess] using
> CDBI::Clients->retrieve .... maybe there is a translation module or
> something.. I dunno.

I have a 'hashref' method in my Class::DBI base class that flattens
the data into a hashref:

sub hashref {
  my $self = shift;
  die "Unknown column requested" if grep { ! $self->find_column($_) } @_;
  my @cols = @_ ? @_ : $self->columns();
  my %hash;
  @[EMAIL PROTECTED] = map { defined $_ ? "".$_ : undef } $self->get(@cols);
  return \%hash;
}

And the results of that can be sent to FillInForm using the 'fdat'
option.  Or just use the FillInForm plugin which will automatically
detect that you passed in a hasref and it will automatically use the
'fdat' option.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to