FAQ
Hi,

I am developing a small "media bookshelf" where I want to display in a matrix-like layout - among other informations - covers in png format (which are saved in a BLOB in my Mysql-DB). I have something like [1] in my mind. The problem I have now is, that only ONE cover is displayed at a time. The relevant code looks like this:

matrix.tt2:
-----------

<div class="table">
<div class="tr">
[% FOREACH m IN medien %]
[% IF ! (loop.count mod 4) %]
</div>
<div class="tr">
[% END %]
<div class="td">
<div class="table">
<div class="tr">
<div class="td"><object type="[% m.mime %]" data="[% c.uri_for(c.controller.action_for('cover'), [m.id]) %]" width="236" height="300"></object></div>
</div>
<div class="tr">
<div class="td">[% m.titel %]</div>
</div>
<div class="tr">
<div class="td">[% m.typ %]</div>
</div>
</div>
</div>
[% END %]
</div>
</div>

Medien.pm:
----------

sub cover :Chained('object') :PathPart('cover') :Args(0) {
my ($self, $c) = @_;

my $medium = $c->stash->{object};
$c->response->header('Content-Type' => $medium->mime . "; charset=\"ISO-8859-1\"");
$c->response->write($medium->cover);
}

I think I now where the problem is, but I do not know how I can fix it properly: The cover action in my Medien controller works with $c->response and therefor creates a new response for each object-tag in my tt2. So only the "last" cover is displayed.

Can anybody help me on how I get all covers displayed simultaneously?

Thanks

J?rgen

[1] http://forum.computerbild.de/attachments/benutzer-tutorials/musikverwaltung-tipps-tricks-problemloesungen-itunes-9073d1232463324-bild6.jpg
--
GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

Search Discussions

  • Tamás Eisenberger at Jan 1, 2010 at 11:56 pm
    Hy!

    The code, looks good to me, the problem maybe in the action that
    captures the argument for the chain, to confirm that, please check that
    all the object's data attributes generated right, and check the debug
    output for the server to see if all the object's requests, succeeds (
    you can see the error messages that catalyst generates for the images,
    if you change the object's to iframes... so then the images may display
    ugly, but you can see the error messages it they sent instead of an image...
    On 01/01/2010 09:30 PM, "Jürgen Hensch" wrote:
    Hi,

    I am developing a small "media bookshelf" where I want to display in a matrix-like layout - among other informations - covers in png format (which are saved in a BLOB in my Mysql-DB). I have something like [1] in my mind. The problem I have now is, that only ONE cover is displayed at a time. The relevant code looks like this:

    matrix.tt2:
    -----------

    <div class="table">
    <div class="tr">
    [% FOREACH m IN medien %]
    [% IF ! (loop.count mod 4) %]
    </div>
    <div class="tr">
    [% END %]
    <div class="td">
    <div class="table">
    <div class="tr">
    <div class="td"><object type="[% m.mime %]" data="[% c.uri_for(c.controller.action_for('cover'), [m.id]) %]" width="236" height="300"></object></div>
    </div>
    <div class="tr">
    <div class="td">[% m.titel %]</div>
    </div>
    <div class="tr">
    <div class="td">[% m.typ %]</div>
    </div>
    </div>
    </div>
    [% END %]
    </div>
    </div>

    Medien.pm:
    ----------

    sub cover :Chained('object') :PathPart('cover') :Args(0) {
    my ($self, $c) = @_;

    my $medium = $c->stash->{object};
    $c->response->header('Content-Type' => $medium->mime . "; charset=\"ISO-8859-1\"");
    $c->response->write($medium->cover);
    }

    I think I now where the problem is, but I do not know how I can fix it properly: The cover action in my Medien controller works with $c->response and therefor creates a new response for each object-tag in my tt2. So only the "last" cover is displayed.

    Can anybody help me on how I get all covers displayed simultaneously?

    Thanks

    Jürgen

    [1] http://forum.computerbild.de/attachments/benutzer-tutorials/musikverwaltung-tipps-tricks-problemloesungen-itunes-9073d1232463324-bild6.jpg
    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: smime.p7s
    Type: application/pkcs7-signature
    Size: 4813 bytes
    Desc: S/MIME Cryptographic Signature
    Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100102/69431f96/smime.bin
  • Jürgen Hensch at Jan 2, 2010 at 7:13 am
    Hi Tam?s,

    according to the server's debug output, all images are created correctly (ie. the requests succeed). If I switch from the object tag to iframe, all images (except the last one which is displayed correctly) produce an error message in their iframe's: "Die Grafik http://... kann nicht angezeigt werden, weil sie einen Fehler enth?lt" (Something like "The image http://... cannot be displayed because it contains an error.")

    Any idea?

    -------- Original-Nachricht --------
    Datum: Sat, 02 Jan 2010 00:56:27 +0100
    Von: "Eisenberger Tam?s" <tamas@eisenberger.hu>
    An: The elegant MVC web framework <catalyst@lists.scsys.co.uk>
    Betreff: Re: [Catalyst] display multiple png\'s simultaneously
    Hy!

    The code, looks good to me, the problem maybe in the action that
    captures the argument for the chain, to confirm that, please check that
    all the object's data attributes generated right, and check the debug
    output for the server to see if all the object's requests, succeeds (
    you can see the error messages that catalyst generates for the images,
    if you change the object's to iframes... so then the images may display
    ugly, but you can see the error messages it they sent instead of an
    image...
    --
    GRATIS f?r alle GMX-Mitglieder: Die maxdome Movie-FLAT!
    Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
  • Jürgen Hensch at Jan 3, 2010 at 12:51 pm
    Hmm, never mind: I don't know *what* I changed, but now it seems to work as intended - i.e. *all* covers are displayed simultaneously.

    confused greetings

    J?rgen
    --
    Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
    sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJan 1, '10 at 8:30p
activeJan 3, '10 at 12:51p
posts4
users2
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase