<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Francisco Obispo <fobispo@isc.org></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">The elegant MVC web framework <catalyst@lists.scsys.co.uk></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">04/04/2012 09:47 AM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Catalyst] Error loading data from
schema</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>The error is because $c->model('dbms::ACCOUNT_VIEW')
is not defined.<br>
<br>
Did you create the view after creating the model? if so, try re-running
the create script so it can pick up the changes.<br>
<br>
Also, to avoid fatal errors, you should attempt to load the model first,
and then send to the template a data structure only if it loads properly.<br>
<br>
<br>
<br>
On Apr 4, 2012, at 7:28 AM, Kenneth S Mclane wrote:<br>
<br>
> I am getting the following error: Caught exception in dbms::Controller::AccountView->list
"Can't call method "all" on an undefined value at /tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm
line 7." <br>
> <br>
> this is the referenced sub: <br>
> <br>
> sub list : Local { <br>
> my ($self, $c) = @_; <br>
> $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
<br>
> $c->stash(template => 'accountview/list.tt2');
<br>
> } <br>
> <br>
> I have seen quite a few posts about this error but no real explanations
of what is causing the issue. I created a view in the DB containing
the data I need to display on the page. The error is occurring at
this line: $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
which I have tried several different things. If I remove the ->all I
get no error and my header row appears. I cannot find anything that tells
me specifically what this should be composed of. Any pointers to help figure
this out are appreciated.<br>
> <br>
> Regards <br>
> <br>
</font></tt>
<br><tt><font size=2>Thanks for the quick response. I did create it after
but I also re-ran the script and it pulled it in. I found my error, I was
using the wrong schema name, hence the object didn't exist. Now it is giving
me "Couldn't render template "accountview/list.tt2: file error
- config/main: not found", so I need to go track that one down. If
I can get this one page working I'll be able to create all the pages I
need then add auth and CRUD and I'm in business.<br>
<br>
<br>
<br>
</font></tt>
<br>
<br>