RE: [Catalyst] TT via AJAX

2012-04-26 Thread Roland Philibert
Hi Will, Thanks for this, am not sure I understand though.. I don't really want to re-build the datastructure as the resultset $rs contains all relationships used by the template. What I want to achieve is send back $body (from my rendered TT) via JSON back to my $.ajax. Any example on how

Re: [Catalyst] TT via AJAX

2012-04-26 Thread Jason Galea
Hi Roland, On Wed, Apr 25, 2012 at 11:26 PM, Roland Philibert rphilib...@aptina.comwrote: Hello all, I’d like to render some HTML content being formatted from a TT view via AJAX. Can anybody recommend a way to do that please? ** ** The method I am using now for AJAX is REST

RE: [Catalyst] TT via AJAX

2012-04-26 Thread Roland Philibert
Hi Jason. If I remove the end action and wite $body in the log, I do get what I want (ie rendered html from my TT with its result variable). ...so your conclusion about not serializing the @content seems to be on the right track. ...is this liked to what Will has suggested to get around

[Catalyst] DBIx::Class::ResultSet::all(): DBI Exception: DBD::DB2::db prepare_cached failed: [IBM][CLI Driver][DB2/AIX64] SQL0204N DBUSERNAME.ACCOUNT_VIEW is an undefined name.

2012-04-26 Thread Kenneth S Mclane
I do not understand this error at all. It is tacking the DB user name onto the model name. Any hints why this is happening? This is my list sub: sub list :Local { my ($self, $c) = @_; $c-stash(accounts = $c-model('ORANGES::AccountView')-all); $c-stash(template =

RE: [Catalyst] TT via AJAX

2012-04-26 Thread Roland Philibert
Hi Will, In your previous suggestion you had: while ( my $rec = $rs-next ) { my %fields = $self-get_important_values( $rec ); push @{ $json-{data} }, { %fields ); } ...what is

Re: [Catalyst] DBIx::Class::ResultSet::all(): DBI Exception: DBD::DB2::db prepare_cached failed: [IBM][CLI Driver][DB2/AIX64] SQL0204N DBUSERNAME.ACCOUNT_VIEW is an undefined name.

2012-04-26 Thread David Schmidt
$rs-all returns an array so you should call it in list context like this. $c-stash( accounts = [ $c-model('ORANGES::AccountView')-all ] ); no idea if that changesyour error msg but it is a start. david On 26 April 2012 21:05, Kenneth S Mclane ksmcl...@us.ibm.com wrote: I do not understand

Re: [Catalyst] TT via AJAX

2012-04-26 Thread Jason Galea
On Fri, Apr 27, 2012 at 12:03 AM, Roland Philibert rphilib...@aptina.comwrote: If I remove the end action and wite $body in the log, I do get what I want (ie rendered html from my TT with its “result” variable). …so your conclusion about not serializing the @content seems to be on the right