On Wed, 2005-11-09 at 19:52 +0100, Jim Mintha wrote:
> Bit by bit I understand more of what goes on inside maypole.  But for
> every success I have, I get stumped on the next thing.

This is the process we all go through :(  For pretty much everything to
do with computers :) Don't be downhearted.

> What I would like to do, is after a record as added, update one of the
> fields based on a info in the new record for a foreign key.  So if the
> user fills in the form for a new "server" record:
> 
> Hostname:
> Vendor:            (drop down list for the "has_a" from the vendor table)
> 
> I want to then update the (not displayed) field "Comment" with
> something like: "for problems contact vendor: Dell"

I'm not an FB expert so there may be something I'm missing. But this
sounds to me more like a CDBI question than a Maypole one. So my
suggestion is to check into how to use triggers in CDBI.

> The way I'm trying to do it now, is to override the "addnew" model
> method (this is FormBuilder).  I am able to change fields, but what I
> can't figure how to do is get the stringified name "Dell".  The user
> chooses "Dell" from the select box, but the value passed back is
> ID field, something like 1034.  
> 
> So I'm sitting in my Addnew method, I have the variables $self, and
> $r, how can I get "Dell" from 1034 out of the Vendor table.

$self->vendor->name ?
$self->vendor->stringify_self ?
''.$self->vendor ?

Cheers, Dave

> Any help appreciated.
> Jim
> 
> PS: Is there a way to use Maypole::CLI with Formbuilder?




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to