On 12/21/05, Kieren Diment <[EMAIL PROTECTED]> wrote:
>
>
> > Use classmetadata.cgi instead of classmetadata.columns
> >
>
> Unfortunately it's not as straightforward as that, as
> classmetadata.cgi doesn't maintain state by itself; i.e:
>
> [% dumper.dump_html(item.to_field(classmetadata.cgi.project)) ;
> dumper.dump_html(classmetadata.cgi.project.as_XML);
> dumper.dump_html(item.to_field(classmetadata.columns.0).as_XML);
> %]
>
> outputs (irrelevant bits removed):
>
> $VAR1 = '';
> $VAR1 = '<select name="project"><option value="6">MTO Analysis</
> option></select>';
> $VAR1 = '<select name="project"><option selected="selected"
> value="6">MTO Analysis</option></select>';
>
That is right. Maypole::View::Base, or whatever has the vars sub in it
:) , does not ever call to_cgi with the object i do not think. You
have to do that yourself. In your "edit" method you could do
something like this:
sub edit : Exported {
my ($self, $r, $obj) = @_;
# handle edit called without an object arg
return $r->error("You need an object to edit interface buster. " )
unless $obj;
$r->template_args->{classmetadata}{cgi} = $obj->to_cgi;
}
hth
--
pjs
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel