Re: StreamResponse on Success
Thanks .. that's what i'll do ... some page refresh from javascript .. Em Thu, 17 Sep 2009 11:55:03 -0300, jose luis sanchez escreveu: Anyone on this, please ? Tapestry doesn't do a redirect-after-post when you return a StreamResponse. HTTP doesn't allow to return two different responses at the same time (CSV and HTML, in your case). One possible solution is to force a page refresh using Javascript. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: StreamResponse on Success
Em Thu, 17 Sep 2009 11:55:03 -0300, jose luis sanchez escreveu: Anyone on this, please ? Tapestry doesn't do a redirect-after-post when you return a StreamResponse. HTTP doesn't allow to return two different responses at the same time (CSV and HTML, in your case). One possible solution is to force a page refresh using Javascript. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: StreamResponse on Success
Hi, i think that it's not possible. Either you return a block for a zone update or the whole page or, in your case return a streamresponse. I would insert a second submit or actionlink called "Calculate results" which count the possible results and update the label. Am 17.09.2009 um 16:55 schrieb jose luis sanchez: Anyone on this, please ? Hi all. I've found myself a problem in an application i've developed using T5.1 There's a page, with 2 datefields, ( From / To ), and a Submit. The Submit button calls the StreamResponse onSuccess() method , returning a CVS file with a list of records. But i'd like to show a label with the total records output, but it looks likes there's no page refresh , so the total value is not updated. Any help on this ? Thanks. /*** tml ***/ t:id="createbutton" value="export"/> You have exported ${total} transactions / java / @Property private int total; StreamResponse onSuccess() { List transactionList = theSession.createCriteria(HSITransaction.class) .add(Restrictions.ge("transactionDate", fromDate)) .add(Restrictions.le("transactionDate", toDate)) .list(); total = transactionList.size(); if (total > 0) { try { return exportCSV(transactionList); } catch (Exception e) { theForm.recordError("Sorry, there was an error exporting CDR's :"+e.getMessage()); } } else theForm.recordError("Sorry, there was no data to export"); return null; } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org smime.p7s Description: S/MIME cryptographic signature
Re: StreamResponse on Success
Anyone on this, please ? Hi all. I've found myself a problem in an application i've developed using T5.1 There's a page, with 2 datefields, ( From / To ), and a Submit. The Submit button calls the StreamResponse onSuccess() method , returning a CVS file with a list of records. But i'd like to show a label with the total records output, but it looks likes there's no page refresh , so the total value is not updated. Any help on this ? Thanks. /*** tml ***/ format="dd/MM/"/> format="dd/MM/"/> t:id="createbutton" value="export"/> You have exported ${total} transactions / java / @Property private int total; StreamResponse onSuccess() { List transactionList = theSession.createCriteria(HSITransaction.class) .add(Restrictions.ge("transactionDate", fromDate)) .add(Restrictions.le("transactionDate", toDate)) .list(); total = transactionList.size(); if (total > 0) { try { return exportCSV(transactionList); } catch (Exception e) { theForm.recordError("Sorry, there was an error exporting CDR's :"+e.getMessage()); } } else theForm.recordError("Sorry, there was no data to export"); return null; } - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org