On 2/28/06 2:24 AM, [EMAIL PROTECTED] wrote:
> On 27 Feb 2006 at 11:20, John Siracusa wrote:
>> Yeah, I'll spell it out in the docs.  Basically, all I need to for
>> consumption by Rose::HTML::Form is build is a structure like this:
> 
> Perhaps I misunderstood something here but I thought we are talking about a
> conveniance method in Rose::DB::Object to fill an object from a CGI query
> object.

What I was talking about was a convenience method to fill a Rose::HTML::Form
based on a CGI object.  Then you'd use Rose::HTML::Form's existing
object_from_form() method to fill in the arbitrary object.   Something like:

    $cgi = CGI->new;
    ...
    $form = MyPersonForm->new; # $form "isa" Rose::HTML::Form
    $form->init_fields_with_cgi($cgi);
    $person = $form->person_from_form;

which would be a shorter form of:

    $form = MyPersonForm->new; # $form "isa" Rose::HTML::Form
    $form->params_from_cgi($cgi);
    $form->init_fields;
    $person = $form->person_from_form;

which would be a shorter form of:

    $form = MyPersonForm->new; # $form "isa" Rose::HTML::Form

    my %params;

    foreach my $param ($cgi->param)
    {
      my @values = $cgi->param($param);
      $params{$param} = @values > 1 ? [EMAIL PROTECTED] : $values[0];
    }

    $form->params(\%params);
    $form->init_fields;
    $person = $form->person_from_form;

-John




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to