<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Thanks to everyone involved I finally
      managed to get it done;<br>
      <br>
      For people with the same problem, here is an example for what I
      did,<br>
      <br>
      my $parameterhash;<br>
      get '/routeA/:*?' => sub {<br>
          my $id = params->{'id'};<br>
          my $blub = params->{'blub'};<br>
          delayed {<br>
             my $tt = Template->new(<br>
                {INCLUDE_PATH => "$path",<br>
                 WRAPPER  => 'layout.tt',            <br>
                 RELATIVE => 1,<br>
                }) || die "Template error: $Template::ERROR\n";<br>
             $tt->process('view.tt', {<br>
                  'id' => $id,<br>
                  'bla' => $blub<br>
              };<br>
          content $tt;<br>
          done;<br>
      ## Manual states from here on we can do whatever we want without
      intereferring with the stream<br>
          $parameterhash = <br>
              {<br>
                  'id' => $id,<br>
                  'bla' => $blub<br>
              };<br>
          };<br>
      };<br>
      <br>
      get '/routeB/:*?' => sub {<br>
      ## parameters are now fetched from the parameterhash reference<br>
          my $id = $parameterhash->{'id'};<br>
          my $blub = $parameterhash->{'bla'};<br>
      <br>
      # Do something from here on<br>
            my $addition = "something";<br>
          delayed {<br>
             my $tt = Template->new(<br>
                {INCLUDE_PATH => "$path",<br>
                 WRAPPER  => 'layout.tt',            <br>
                 RELATIVE => 1,<br>
                }) || die "Template error: $Template::ERROR\n";<br>
             $tt->process('view2.tt', {<br>
                  'id' => $id,<br>
                  'bla' => $blub<br>
                  'addition' => $addition<br>
              };<br>
          content $tt;<br>
          done;<br>
      }; <br>
      <br>
      In the template view.tt<br>
      I simply added<br>
      <br>
      <script type="text/javascript"><br>
          $(document).ready( function () {<br>
      // Javascript URL redirection after 5 seconds<br>
          setTimeout(function() {<br>
              var str = window.location.href;<br>
              var res = str.replace("routeA", "routeB");<br>
          window.location.replace(res);<br>
          }, 5000);<br>
          });<br>
      </script><br>
      <br>
      which forwards to routeB,<br>
      seems to work fine.<br>
      <br>
      The way I use it now I do not need delayed actually,<br>
      but it doesn't hurt, so I keep for the moment.<br>
      <br>
      Thanks again to everybody!<br>
      <br>
      --joerg<br>
      <br>
      <br>
      On 10/16/2015 01:51 PM, Clive Eisen wrote:<br>
    </div>
    <blockquote
      cite="mid:F0B396E8-6C9A-4FAD-BB70-6020E1F42059@hildebrand.co.uk"
      type="cite">
      <pre wrap="">Other people have told you how to do this

In your template have callbacks to OTHER routes that return the rest of the data as and when it’s available

If you  insist use the same route and figure out from a param whether its the initial call or a callback

As far as I can tell once you have served a template that request is closed

--
Clive Eisen
GPG: 75056DD0






</pre>
      <blockquote type="cite">
        <pre wrap="">On 16 Oct 2015, at 11:31, Joerg Fallmann <a class="moz-txt-link-rfc2396E" href="mailto:fall@tbi.univie.ac.at"><fall@tbi.univie.ac.at></a> wrote:

To circumvent this I thought about forwarding to another route
after processing a template,
this should actually work around the update existing output problem,
but it seems this is not possible either
so I really got no idea how to proceed at the moment.

--joerg

On 10/16/2015 09:05 AM, Yitzchak Scott-Thoennes wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">For this to work, you'd either need a template engine that is tightly integrated into Dancer or a streaming template engine (that would call a callback to call content as it got chunks) with the ability to loop over iterators or trigger callbacks to get more data to format.  Though I guess you could use a normal template loop over a tied array too.

But I don't know of such a template engine.



_______________________________________________
dancer-users mailing list

<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
        </blockquote>
        <pre wrap="">
_______________________________________________
dancer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
      </blockquote>
      <pre wrap="">
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
dancer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>