Return-Path: Delivered-To: apmail-tapestry-users-archive@www.apache.org Received: (qmail 60386 invoked from network); 4 Mar 2011 12:25:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 12:25:22 -0000 Received: (qmail 10169 invoked by uid 500); 4 Mar 2011 12:25:21 -0000 Delivered-To: apmail-tapestry-users-archive@tapestry.apache.org Received: (qmail 10144 invoked by uid 500); 4 Mar 2011 12:25:21 -0000 Mailing-List: contact users-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tapestry users" Delivered-To: mailing list users@tapestry.apache.org Received: (qmail 10136 invoked by uid 99); 4 Mar 2011 12:25:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 12:25:21 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thiagohp@gmail.com designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 12:25:15 +0000 Received: by gyd5 with SMTP id 5so1017335gyd.11 for ; Fri, 04 Mar 2011 04:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:content-type:to:subject:references:date :mime-version:content-transfer-encoding:from:message-id:in-reply-to :user-agent; bh=fnb8WEhCmCvaaAVEUtnIKZnkwDGcA4PEvpIa07oUZqQ=; b=agvYVxD6ScUExCttjbViCHi9OuQC3bXDTijDfBfxwyxfi5ZNdKFH+flCafubvF96aH 8cgmk6OJR3C32VBnhDtv6vVQ7h+vc6mw8uSVBBZlvdPNfh9tzptWpjW/edverJG5JnAt F/h3xNSn80RcOHyUPJGpBmPq/DGE2Hs7TYQVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; b=x6mfeaZojnpo67zC10brcMXUDeXhdw44Ltir9XscOXb/ynAjqRuFAcz9no4jEasUOf T4nUIvSCH71EWFTQjqV7WCjuI4YGvNsQKwZNPCDJG2TU+jL0gJDD+Dn7qrA68mc+27fY mysXWKQStA7s686kKz5d3ih9vQmMEUt3OxPNA= Received: by 10.236.27.98 with SMTP id d62mr1020888yha.5.1299241494009; Fri, 04 Mar 2011 04:24:54 -0800 (PST) Received: from arsmachina ([201.80.243.36]) by mx.google.com with ESMTPS id x29sm1550231yhc.28.2011.03.04.04.24.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 04:24:53 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Tapestry users" Subject: Re: Invoke method after page is loaded; when method finishes, redirect to another page References: Date: Fri, 04 Mar 2011 09:24:41 -0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Thiago H. de Paula Figueiredo" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.01 (Linux) On Fri, 04 Mar 2011 08:38:44 -0300, Nikola Milikic = wrote: > Hi to all, Hi! > I'm a newbie to Tapestry and would be grateful for a small assistance.= Welcome to hte mailing list! > Since in my Tapestry 5.2 application I'm doing some calculations which= = > can take up to 30 seconds, I wanted to implement when a user clicks on= a = > button e.g. 'Calculate' to be transferred to a separate page on which = the > calculation will be done (with some message like "Calculation in = > progress, please wait" and loading icon). > > My question is how to automatically after the calculation has been don= e > (method doing calculation ended) to transfer the user to a separate pa= ge = > to display results? Remember that HTTP itself doesn't provide server to client communication= , = just the opposite. You'll need some AJAX code to request to the page if = = the calculation is finished. You can find some custom AJAX examples in = this mailing list or in the Tapestry JumpStart. When it's finished, use = = window.location to redirect. > My first idea was to annotate the method with @PageLoaded annotation: > @InjectPage >> private ResultsPage resultsPage ; > > >> @PageLoaded >> ResultsPage calculate (){ >> // calculation here >> resultsPage.setResults(somethingHere); >> return resultsPage; >> } > > > but that wont do it. And in the documentation it is stated that this = > method should return void. @PageLoaded is invoked just the first time the page class is instanced, = = and in 5.2 this is going to be done just once for the whole webapp life.= -- = Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,= = and instructor Owner, Ars Machina Tecnologia da Informa=C3=A7=C3=A3o Ltda. http://www.arsmachina.com.br --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For additional commands, e-mail: users-help@tapestry.apache.org