Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users
TT via AJAX
 

Index | Next | Previous | View Flat


rphilibert at aptina

Apr 25, 2012, 6:26 AM


Views: 370
Permalink
TT via AJAX

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 controller and JSON View.



...

sub ajaxaction :Local :ActionClass('REST') {}



sub ajaxaction _GET {



my ($self, $c) = @_;

my $rs = $c->model(DN)->resultset(Table)->find(...);

my $body = $c->view(MYTT)->render($c,'dir/temp.mailtt',$c->stash( result => [ $rs ] )); ß this is the weird bit I guess.

my @content =();

push @content, $body;

$self->status_ok(

$c,

entity => \@content,

);

}

sub end :Private {

my ($self, $c) = @_;

$c->forward("View::JSON");

}



..but doing this I get the error:



Caught exception in MyApp::View::JSON->process "encountered object 'MyApp::Model::DB::Table=HASH(0xdb2c330)', but neither allow_blessed nor convert_blessed settings are enabled at (eval 1606) line 151."



Thanks for your help.

Roland




















































Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12 2XT. Registered in England No. 06570543.

This e-mail and any attachments contain confidential information and are solely for the review and use of the intended recipient. If you have received this e-mail in error, please notify the sender and destroy this e-mail and any copies.

Subject User Time
TT via AJAX rphilibert at aptina Apr 25, 2012, 6:26 AM
    Re: TT via AJAX will.trillich at serensoft Apr 25, 2012, 6:53 AM
    Re: TT via AJAX mattp at cpan Apr 25, 2012, 6:56 AM
    RE: TT via AJAX rphilibert at aptina Apr 26, 2012, 5:21 AM
    Re: TT via AJAX will.trillich at serensoft Apr 26, 2012, 6:02 AM
    Re: TT via AJAX lists at eightdegrees Apr 26, 2012, 6:31 AM
    RE: TT via AJAX rphilibert at aptina Apr 26, 2012, 7:03 AM
    RE: TT via AJAX rphilibert at aptina Apr 26, 2012, 12:24 PM
    Re: TT via AJAX will.trillich at serensoft Apr 26, 2012, 1:26 PM
    Re: TT via AJAX lists at eightdegrees Apr 26, 2012, 6:51 PM
    RE: TT via AJAX rphilibert at aptina Apr 27, 2012, 4:54 AM
    Re: TT via AJAX lists at eightdegrees Apr 27, 2012, 5:29 AM
    RE: TT via AJAX rphilibert at aptina Apr 27, 2012, 8:15 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.