7 msgConfiguration of $c->log with Catalyst::Log:...
8 msgInvalid session ids being generated
4 msgCatalyst / dbix-class / mysql / REST job
2 msgStrange UTF16 warning
1 msgWikipedia article improvement?
5 msgFastCGI: incomplete headers (0 bytes) received ...
5 msgBasic CRUD Tutorial
2 msgHow to display a single HTML::Widget form field...
7 msgLet's port Twitter to Perl
8 msgCatalyst, utf8 in form element type text
17 msgAnybody who fancies some LWP poking ...
54 msgRFC: Catalyst::Controller::REST::DBIC
1 msgKill the book thread please
2 msgMore Catalyst Template Toolkit examples?
6 msgFw: high school reunion (no subject)
2 msg(no subject)
6 msgUsing URIs for my app in another program
4 msgTutorial
11 msg$row->copy causing exit from controller(!)

How to print/display some data in an end action
\ Emmanuel Quevillon (30 Apr 2008)
. \ Andreas Marienborg (30 Apr 2008)
. . \ Emmanuel Quevillon (30 Apr 2008)
. . . \ Aristotle Pagaltzis (30 Apr 2008)
. . . . \ Emmanuel Quevillon (30 Apr 2008)
. . . . . \ Aristotle Pagaltzis (30 Apr 2008)
. . . . . . \ Emmanuel Quevillon (5 May 2008)
. . . . . . . \ Kieren Diment (5 May 2008)
. . . . . \ Andreas Marienborg (1 May 2008)
. . . . . . \ Aristotle Pagaltzis (1 May 2008)
. . . . . . . \ Emmanuel Quevillon (5 May 2008)
. . . . . \ Matt S Trout (5 May 2008)
. \ Mitch Jackson (30 Apr 2008)
. \ Emmanuel Quevillon (5 May 2008)

Subject:How to print/display some data in an end action
Group:Catalyst
From:Emmanuel Quevillon
Date:30 Apr 2008


 
Hi,

I'd like to incorporate an action into an <object> tag that
only prints some data (XML SVG).
I have an action in a controller Foo that do this :

sub display : Local : Args(1) {
....
my $t = $object->display_graph();
$c->detach('Foo', 'end', [$t]);
}

sub end : Private {
my($self, $c) = @_;
my $g = $c->req->args()->[0];
print $g;
}

then in a template :

<object data="http://..../display/1"></object>

However, my output remains empty in my template.
If I directly call the 'display' action from my browser as :

http://.../display/1, it works ok although I get some extra
code from Catalyst :

1HTTP/1.0 200 OK
Connection: close
Date: Wed, 30 Apr 2008 09:47:49 GMT
Status: 200
X-Catalyst: 5.7012

and so an xml error parsing reported.

So my questions are:

1: Do I do this the best way?
2: If so, how to avoid to print this extra code from catalyst?

Thanks in advance

--
-------------------------
Emmanuel Quevillon
Biological Software and Databases Group
Institut Pasteur
+33 1 44 38 95 98
tuco at_ pasteur dot fr
-------------------------

_______________________________________________
List: Catalyst
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst/
Dev site: http://dev.catalyst.perl.org/


© 2004-2008 readlist.com