You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/11/05 03:45:04 UTC

t5: updating a zone during loading of page?

Hi,

Zone has to be updated by an actionlink or a form, is there another way?
here is what I intend to use:

1. when page is loaded:
   < t:zone t:id="content" show="slidedown" update="show" >Loading, please
wait.. < /t:zone>

2. the template retrieves some other info from the server thru ${moreInfo}
which takes a longer time, I'd like this to go into the zone above so it
overwrites the 'loading, please wait...'

any hints to accomplish this? Thanks.

A.C.

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208359.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: updating a zone during loading of page?

Posted by DH <ni...@gmail.com>.
Hi,

See component ProgressiveDisplay.

DH
http://www.gaonline.com.cn

----- Original Message ----- 
From: "Angelo Chen" 
To: <us...@tapestry.apache.org>
Sent: Thursday, November 05, 2009 10:45 AM
Subject: t5: updating a zone during loading of page?


> 
> Hi,
> 
> Zone has to be updated by an actionlink or a form, is there another way?
> here is what I intend to use:
> 
> 1. when page is loaded:
>   < t:zone t:id="content" show="slidedown" update="show" >Loading, please
> wait.. < /t:zone>
> 
> 2. the template retrieves some other info from the server thru ${moreInfo}
> which takes a longer time, I'd like this to go into the zone above so it
> overwrites the 'loading, please wait...'
> 
> any hints to accomplish this? Thanks.
> 
> A.C.
> 
> -- 
> View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208359.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>

Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

the effect I want is, it shows wait messages first, then the image
overwrites that area, ProgressDisplay does not work in this case, I ended up
using javascript.


Ville Virtanen wrote:
> 
> Hi,
> 
> atleast the example you gave, the image is _not_ loaded using ajax. The
> html is, which triggers the browser to download and display the image,
> right?
> 
> In the example you gave, the ${myimagestreamresponse} returns the URL that
> can be used to download the image, not the actual image. So -> the
> progressive display downloads only that tag, updates the view and _then_
> the browser starts to download the image.
> 
> t:ProgressiveDisplay initial="block:waitmsg"
>         img src="${myimagestreamresponse}" /
>  /t:ProgressiveDisplay
> 
>  - Ville
> 
> Ps. If you ever solve this please reply to one of these messages as I'm
> interested in the possible solution.
> 
> 
> Angelo Chen wrote:
>> 
>> Hi,
>> 
>> Seems not working, image generation takes a while, that's the reason I'd
>> like to display 'waiting...', now I can get the jpeg stream in an ajax
>> call, problem is how to display it?
>> 
>> A.C.
>> 
>> Ville Virtanen wrote:
>>> 
>>> Hi again,
>>> 
>>> I have had this problem also with images, as the T5 progressive display
>>> only fetches the img TAG from the server -> updates the dom and then the
>>> browser starts to load the image... So the progressive display is
>>> working correctly. If you could embed the image to the transmission it
>>> would work as you'd like to, but don't know if that is possible. I'm
>>> afraid that in your case you have to do some custom coding. 
>>> 
>>> Our case is that we're generating pdf:s that can be preview'd as images
>>> in web environment, and the pdf generation takes some time..
>>> 
>>> Perhaps you could use something like this:
>>> http://www.orientimport.fi/en/info/products/productlist click any of the
>>> pictures to see the effect. The javascript solution displays the loading
>>> image until the image is loaded, and that's what you need, right?
>>> 
>>>  - Ville
>>> 
>>> 
>>> Angelo Chen wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> Thanks for the reply, looks like ProgressDisplay is the one I'm looking
>>>> for, I did a test:
>>>> 
>>>> <t:ProgressiveDisplay initial="block:waitmsg">
>>>>          ${myimagestreamresponse} 
>>>>  </t:ProgressiveDisplay>
>>>> 
>>>> myImagestreamResponse returns a jpeg from an page event, it takes a
>>>> little more time to generate. above code displays the initial block,
>>>> then immediately erase it, wait for a while for the image to be
>>>> generated, then display the image, so it is not progressive, probably
>>>> something is missing in my code? Thanks.
>>>> 
>>>> A.C. 
>>>> 
>>>> Ville Virtanen wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> have looked into
>>>>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
>>>>> ?
>>>>> 
>>>>> Maybe that solves it?
>>>>> 
>>>>>  - Ville
>>>>> 
>>>>> 
>>>>> Angelo Chen wrote:
>>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> Zone has to be updated by an actionlink or a form, is there another
>>>>>> way? here is what I intend to use:
>>>>>> 
>>>>>> 1. when page is loaded:
>>>>>>    < t:zone t:id="content" show="slidedown" update="show" >Loading,
>>>>>> please wait.. < /t:zone>
>>>>>> 
>>>>>> 2. the template retrieves some other info from the server thru
>>>>>> ${moreInfo} which takes a longer time, I'd like this to go into the
>>>>>> zone above so it overwrites the 'loading, please wait...'
>>>>>> 
>>>>>> any hints to accomplish this? Thanks.
>>>>>> 
>>>>>> A.C.
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208633.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Ville Virtanen <vi...@cerion.fi>.
Hi,

atleast the example you gave, the image is _not_ loaded using ajax. The html
is, which triggers the browser to download and display the image, right?

In the example you gave, the ${myimagestreamresponse} returns the URL that
can be used to download the image, not the actual image. So -> the
progressive display downloads only that tag, updates the view and _then_ the
browser starts to download the image.

t:ProgressiveDisplay initial="block:waitmsg"
        img src="${myimagestreamresponse}" /
 /t:ProgressiveDisplay

 - Ville

Ps. If you ever solve this please reply to one of these messages as I'm
interested in the possible solution.


Angelo Chen wrote:
> 
> Hi,
> 
> Seems not working, image generation takes a while, that's the reason I'd
> like to display 'waiting...', now I can get the jpeg stream in an ajax
> call, problem is how to display it?
> 
> A.C.
> 
> Ville Virtanen wrote:
>> 
>> Hi again,
>> 
>> I have had this problem also with images, as the T5 progressive display
>> only fetches the img TAG from the server -> updates the dom and then the
>> browser starts to load the image... So the progressive display is working
>> correctly. If you could embed the image to the transmission it would work
>> as you'd like to, but don't know if that is possible. I'm afraid that in
>> your case you have to do some custom coding. 
>> 
>> Our case is that we're generating pdf:s that can be preview'd as images
>> in web environment, and the pdf generation takes some time..
>> 
>> Perhaps you could use something like this:
>> http://www.orientimport.fi/en/info/products/productlist click any of the
>> pictures to see the effect. The javascript solution displays the loading
>> image until the image is loaded, and that's what you need, right?
>> 
>>  - Ville
>> 
>> 
>> Angelo Chen wrote:
>>> 
>>> Hi,
>>> 
>>> Thanks for the reply, looks like ProgressDisplay is the one I'm looking
>>> for, I did a test:
>>> 
>>> <t:ProgressiveDisplay initial="block:waitmsg">
>>>          ${myimagestreamresponse} 
>>>  </t:ProgressiveDisplay>
>>> 
>>> myImagestreamResponse returns a jpeg from an page event, it takes a
>>> little more time to generate. above code displays the initial block,
>>> then immediately erase it, wait for a while for the image to be
>>> generated, then display the image, so it is not progressive, probably
>>> something is missing in my code? Thanks.
>>> 
>>> A.C. 
>>> 
>>> Ville Virtanen wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> have looked into
>>>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
>>>> ?
>>>> 
>>>> Maybe that solves it?
>>>> 
>>>>  - Ville
>>>> 
>>>> 
>>>> Angelo Chen wrote:
>>>>> 
>>>>> Hi,
>>>>> 
>>>>> Zone has to be updated by an actionlink or a form, is there another
>>>>> way? here is what I intend to use:
>>>>> 
>>>>> 1. when page is loaded:
>>>>>    < t:zone t:id="content" show="slidedown" update="show" >Loading,
>>>>> please wait.. < /t:zone>
>>>>> 
>>>>> 2. the template retrieves some other info from the server thru
>>>>> ${moreInfo} which takes a longer time, I'd like this to go into the
>>>>> zone above so it overwrites the 'loading, please wait...'
>>>>> 
>>>>> any hints to accomplish this? Thanks.
>>>>> 
>>>>> A.C.
>>>>> 
>>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208626.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

Seems not working, image generation takes a while, that's the reason I'd
like to display 'waiting...', now I can get the jpeg stream in an ajax call,
problem is how to display it?

A.C.

Ville Virtanen wrote:
> 
> Hi again,
> 
> I have had this problem also with images, as the T5 progressive display
> only fetches the img TAG from the server -> updates the dom and then the
> browser starts to load the image... So the progressive display is working
> correctly. If you could embed the image to the transmission it would work
> as you'd like to, but don't know if that is possible. I'm afraid that in
> your case you have to do some custom coding. 
> 
> Our case is that we're generating pdf:s that can be preview'd as images in
> web environment, and the pdf generation takes some time..
> 
> Perhaps you could use something like this:
> http://www.orientimport.fi/en/info/products/productlist click any of the
> pictures to see the effect. The javascript solution displays the loading
> image until the image is loaded, and that's what you need, right?
> 
>  - Ville
> 
> 
> Angelo Chen wrote:
>> 
>> Hi,
>> 
>> Thanks for the reply, looks like ProgressDisplay is the one I'm looking
>> for, I did a test:
>> 
>> <t:ProgressiveDisplay initial="block:waitmsg">
>>          ${myimagestreamresponse} 
>>  </t:ProgressiveDisplay>
>> 
>> myImagestreamResponse returns a jpeg from an page event, it takes a
>> little more time to generate. above code displays the initial block, then
>> immediately erase it, wait for a while for the image to be generated,
>> then display the image, so it is not progressive, probably something is
>> missing in my code? Thanks.
>> 
>> A.C. 
>> 
>> Ville Virtanen wrote:
>>> 
>>> Hi,
>>> 
>>> have looked into
>>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
>>> ?
>>> 
>>> Maybe that solves it?
>>> 
>>>  - Ville
>>> 
>>> 
>>> Angelo Chen wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> Zone has to be updated by an actionlink or a form, is there another
>>>> way? here is what I intend to use:
>>>> 
>>>> 1. when page is loaded:
>>>>    < t:zone t:id="content" show="slidedown" update="show" >Loading,
>>>> please wait.. < /t:zone>
>>>> 
>>>> 2. the template retrieves some other info from the server thru
>>>> ${moreInfo} which takes a longer time, I'd like this to go into the
>>>> zone above so it overwrites the 'loading, please wait...'
>>>> 
>>>> any hints to accomplish this? Thanks.
>>>> 
>>>> A.C.
>>>> 
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208611.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Ville Virtanen <vi...@cerion.fi>.
Hi again,

I have had this problem also with images, as the T5 progressive display only
fetches the img TAG from the server -> updates the dom and then the browser
starts to load the image... So the progressive display is working correctly.
If you could embed the image to the transmission it would work as you'd like
to, but don't know if that is possible. I'm afraid that in your case you
have to do some custom coding. 

Our case is that we're generating pdf:s that can be preview'd as images in
web environment, and the pdf generation takes some time..

Perhaps you could use something like this:
http://www.orientimport.fi/en/info/products/productlist click any of the
pictures to see the effect. The javascript solution displays the loading
image until the image is loaded, and that's what you need, right?

 - Ville


Angelo Chen wrote:
> 
> Hi,
> 
> Thanks for the reply, looks like ProgressDisplay is the one I'm looking
> for, I did a test:
> 
> <t:ProgressiveDisplay initial="block:waitmsg">
>          ${myimagestreamresponse} 
>  </t:ProgressiveDisplay>
> 
> myImagestreamResponse returns a jpeg from an page event, it takes a little
> more time to generate. above code displays the initial block, then
> immediately erase it, wait for a while for the image to be generated, then
> display the image, so it is not progressive, probably something is missing
> in my code? Thanks.
> 
> A.C. 
> 
> Ville Virtanen wrote:
>> 
>> Hi,
>> 
>> have looked into
>> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
>> ?
>> 
>> Maybe that solves it?
>> 
>>  - Ville
>> 
>> 
>> Angelo Chen wrote:
>>> 
>>> Hi,
>>> 
>>> Zone has to be updated by an actionlink or a form, is there another way?
>>> here is what I intend to use:
>>> 
>>> 1. when page is loaded:
>>>    < t:zone t:id="content" show="slidedown" update="show" >Loading,
>>> please wait.. < /t:zone>
>>> 
>>> 2. the template retrieves some other info from the server thru
>>> ${moreInfo} which takes a longer time, I'd like this to go into the zone
>>> above so it overwrites the 'loading, please wait...'
>>> 
>>> any hints to accomplish this? Thanks.
>>> 
>>> A.C.
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208607.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi, good idea, question is, how can we know if the loading is over? if there
is a way in the current ProgressDisplay to trigger that event so that it can
make the img visible?


Howard Lewis Ship wrote:
> 
> Idea for a component: ImagePlaceholder that displays some content in a
> div (a "loading ..." message), and an invisible   tag in an
> non-visible div. When the image is loaded, it removes the loading div
> and makes the   visible.
> 
> On Thu, Nov 5, 2009 at 4:36 PM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
>> Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen
>> <an...@yahoo.com.hk>
>> escreveu:
>>
>>> Hi,
>>
>> Hi!
>>
>>> If we generate the image in the event, and return the link, then we need
>>> to store the image somewhere in the file system, and clean it up later
>>> after
>>> the image got rendered, any idea how to handle this ?
>>
>> Do not generate the image in the event nor store the image. I suggest you
>> to
>> try the approach I've already suggested: create a page that generates the
>> image and returns a StreamResponse of it in its onActivate() method. In
>> your
>> page, just use an  imageLink  tag, with a getImageLink() method
>> that returns a Link to your image page.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and
>> instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação 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
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26226557.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Fermin Da Costa Gomez <da...@dcgconsultancy.nl>.
I would certainly second this. Not in the least because i'm currently
working on a lot of charting things .. ;-)

Since a picture says more than a 1000 words (or so the saying goes) it would
go a long way to 'show users (/bosses?)' the (perceived) power of Tapestry.
Making it easier and more transparent to deal with graphics would certainly
be a very good thing indeed.

Beauty is in the eye of the beholder .. and the user likes his pictures (be
it an image or a graph)

My 2c

Fermin DCG

On Fri, Nov 6, 2009 at 5:22 AM, Ville Virtanen <vi...@cerion.fi>wrote:

>
> Hi,
>
> I think this could be a framework level component, as it seems that there
> are many of us solving the same problem with a bit different approaches.
> (Everyone invents the wheel..)
>
> so +1 for this idea! :)
>
>  - Ville
>
>
> Howard Lewis Ship wrote:
> >
> > Idea for a component: ImagePlaceholder that displays some content in a
> > div (a "loading ..." message), and an invisible   tag in an
> > non-visible div. When the image is loaded, it removes the loading div
> > and makes the   visible.
> >
> > On Thu, Nov 5, 2009 at 4:36 PM, Thiago H. de Paula Figueiredo
> > <th...@gmail.com> wrote:
> >> Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen
> >> <an...@yahoo.com.hk>
> >> escreveu:
> >>
> >>> Hi,
> >>
> >> Hi!
> >>
> >>> If we generate the image in the event, and return the link, then we
> need
> >>> to store the image somewhere in the file system, and clean it up later
> >>> after
> >>> the image got rendered, any idea how to handle this ?
> >>
> >> Do not generate the image in the event nor store the image. I suggest
> you
> >> to
> >> try the approach I've already suggested: create a page that generates
> the
> >> image and returns a StreamResponse of it in its onActivate() method. In
> >> your
> >> page, just use an  imageLink  tag, with a getImageLink() method
> >> that returns a Link to your image page.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> >> and
> >> instructor
> >> Owner, software architect and developer, Ars Machina Tecnologia da
> >> Informação 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
> >>
> >>
> >
> >
> >
> > --
> > Howard M. Lewis Ship
> >
> > Creator of Apache Tapestry
> >
> > The source for Tapestry training, mentoring and support. Contact me to
> > learn how I can get you up and productive in Tapestry fast!
> >
> > (971) 678-5210
> > http://howardlewisship.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26226549.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
“The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.”
- George Bernard Shaw (1856 - 1950)

Re: t5: updating a zone during loading of page?

Posted by Ville Virtanen <vi...@cerion.fi>.
Hi,

I think this could be a framework level component, as it seems that there
are many of us solving the same problem with a bit different approaches.
(Everyone invents the wheel..)

so +1 for this idea! :)

 - Ville


Howard Lewis Ship wrote:
> 
> Idea for a component: ImagePlaceholder that displays some content in a
> div (a "loading ..." message), and an invisible   tag in an
> non-visible div. When the image is loaded, it removes the loading div
> and makes the   visible.
> 
> On Thu, Nov 5, 2009 at 4:36 PM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
>> Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen
>> <an...@yahoo.com.hk>
>> escreveu:
>>
>>> Hi,
>>
>> Hi!
>>
>>> If we generate the image in the event, and return the link, then we need
>>> to store the image somewhere in the file system, and clean it up later
>>> after
>>> the image got rendered, any idea how to handle this ?
>>
>> Do not generate the image in the event nor store the image. I suggest you
>> to
>> try the approach I've already suggested: create a page that generates the
>> image and returns a StreamResponse of it in its onActivate() method. In
>> your
>> page, just use an  imageLink  tag, with a getImageLink() method
>> that returns a Link to your image page.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and
>> instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação 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
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26226549.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Idea for a component: ImagePlaceholder that displays some content in a
div (a "loading ..." message), and an invisible <img> tag in an
non-visible div. When the image is loaded, it removes the loading div
and makes the <img> visible.

On Thu, Nov 5, 2009 at 4:36 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen <an...@yahoo.com.hk>
> escreveu:
>
>> Hi,
>
> Hi!
>
>> If we generate the image in the event, and return the link, then we need
>> to store the image somewhere in the file system, and clean it up later after
>> the image got rendered, any idea how to handle this ?
>
> Do not generate the image in the event nor store the image. I suggest you to
> try the approach I've already suggested: create a page that generates the
> image and returns a StreamResponse of it in its onActivate() method. In your
> page, just use an <img src="imageLink"/> tag, with a getImageLink() method
> that returns a Link to your image page.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação 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
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
I changed the code to exactly what you suggested, the effect is the same:

1. loading...
2. loading got erased when the image started downloading

is there an event that can be triggered when the image finish loading? if
yes, then we can make the img hidden during downloading, visible when done
as suggested by Howard.



Thiago H. de Paula Figueiredo wrote:
> 
> Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen  
> <an...@yahoo.com.hk> escreveu:
> 
>> Hi,
> 
> Hi!
> 
>> If we generate the image in the event, and return the link, then we need  
>> to store the image somewhere in the file system, and clean it up later  
>> after
>> the image got rendered, any idea how to handle this ?
> 
> Do not generate the image in the event nor store the image. I suggest you  
> to try the approach I've already suggested: create a page that generates  
> the image and returns a StreamResponse of it in its onActivate() method.  
> In your page, just use an  imageLink  tag, with a  
> getImageLink() method that returns a Link to your image page.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da  
> Informação 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
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26234684.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 05 Nov 2009 22:06:28 -0200, Angelo Chen  
<an...@yahoo.com.hk> escreveu:

> Hi,

Hi!

> If we generate the image in the event, and return the link, then we need  
> to store the image somewhere in the file system, and clean it up later  
> after
> the image got rendered, any idea how to handle this ?

Do not generate the image in the event nor store the image. I suggest you  
to try the approach I've already suggested: create a page that generates  
the image and returns a StreamResponse of it in its onActivate() method.  
In your page, just use an <img src="imageLink"/> tag, with a  
getImageLink() method that returns a Link to your image page.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação 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


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

If we generate the image in the event, and return the link, then we need to
store the image somewhere in the file system, and clean it up later after
the image got rendered, any idea how to handle this ?

Thanks,

A.C.


Kalle Korhonen-2 wrote:
> 
> You can even handle the progressivedisplay event (i.e. @OnEvent(value
> = EventConstants.PROGRESSIVE_DISPLAY, component =
> "progressiveDisplay")), construct the image there and then render the
> image link to it. ProgressiveDisplay works for most partial rendering
> cases, it's just a matter of how you are using it.
> 
> Kalle
> 
> 
> On Thu, Nov 5, 2009 at 3:07 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
>> Em Thu, 05 Nov 2009 05:40:20 -0200, Angelo Chen
>> <an...@yahoo.com.hk>
>> escreveu:
>>
>>> Hi,
>>
>> Hi!
>>
>> As Ville suggested, instead of
>>
>> <t:ProgressiveDisplay initial="block:waitmsg">
>>         ${myimagestreamresponse}
>> </t:ProgressiveDisplay>
>>
>> try
>>
>> <t:ProgressiveDisplay initial="block:waitmsg">
>>          ${myimagelink} 
>> </t:ProgressiveDisplay>
>>
>> You'll need to create a page that returns the image as a StreamResponse
>> on
>> its onActivate() method. That's what I always do in these cases.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and
>> instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26224579.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
i believe this is the solution, thanks.


Kalle Korhonen-2 wrote:
> 
> You can even handle the progressivedisplay event (i.e. @OnEvent(value
> = EventConstants.PROGRESSIVE_DISPLAY, component =
> "progressiveDisplay")), construct the image there and then render the
> image link to it. ProgressiveDisplay works for most partial rendering
> cases, it's just a matter of how you are using it.
> 
> Kalle
> 
> 
> On Thu, Nov 5, 2009 at 3:07 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
>> Em Thu, 05 Nov 2009 05:40:20 -0200, Angelo Chen
>> <an...@yahoo.com.hk>
>> escreveu:
>>
>>> Hi,
>>
>> Hi!
>>
>> As Ville suggested, instead of
>>
>> <t:ProgressiveDisplay initial="block:waitmsg">
>>         ${myimagestreamresponse}
>> </t:ProgressiveDisplay>
>>
>> try
>>
>> <t:ProgressiveDisplay initial="block:waitmsg">
>>          ${myimagelink} 
>> </t:ProgressiveDisplay>
>>
>> You'll need to create a page that returns the image as a StreamResponse
>> on
>> its onActivate() method. That's what I always do in these cases.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and
>> instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26223288.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Kalle Korhonen <ka...@gmail.com>.
You can even handle the progressivedisplay event (i.e. @OnEvent(value
= EventConstants.PROGRESSIVE_DISPLAY, component =
"progressiveDisplay")), construct the image there and then render the
image link to it. ProgressiveDisplay works for most partial rendering
cases, it's just a matter of how you are using it.

Kalle


On Thu, Nov 5, 2009 at 3:07 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> Em Thu, 05 Nov 2009 05:40:20 -0200, Angelo Chen <an...@yahoo.com.hk>
> escreveu:
>
>> Hi,
>
> Hi!
>
> As Ville suggested, instead of
>
> <t:ProgressiveDisplay initial="block:waitmsg">
>         ${myimagestreamresponse}
> </t:ProgressiveDisplay>
>
> try
>
> <t:ProgressiveDisplay initial="block:waitmsg">
>         <img src="${myimagelink}"/>
> </t:ProgressiveDisplay>
>
> You'll need to create a page that returns the image as a StreamResponse on
> its onActivate() method. That's what I always do in these cases.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação 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
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Thu, 05 Nov 2009 05:40:20 -0200, Angelo Chen  
<an...@yahoo.com.hk> escreveu:

> Hi,

Hi!

As Ville suggested, instead of

<t:ProgressiveDisplay initial="block:waitmsg">
          ${myimagestreamresponse}
</t:ProgressiveDisplay>

try

<t:ProgressiveDisplay initial="block:waitmsg">
          <img src="${myimagelink}"/>
</t:ProgressiveDisplay>

You'll need to create a page that returns the image as a StreamResponse on  
its onActivate() method. That's what I always do in these cases.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação 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


Re: t5: updating a zone during loading of page?

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

Thanks for the reply, looks like ProgressDisplay is the one I'm looking for,
I did a test:

<t:ProgressiveDisplay initial="block:waitmsg">
         ${myimagestreamresponse} 
 </t:ProgressiveDisplay>

myImagestreamResponse returns a jpeg from an page event, it takes a little
more time to generate. above code displays the initial block, then
immediately erase it, wait for a while for the image to be generated, then
display the image, so it is not progressive, probably something is missing
in my code? Thanks.

A.C. 

Ville Virtanen wrote:
> 
> Hi,
> 
> have looked into
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
> ?
> 
> Maybe that solves it?
> 
>  - Ville
> 
> 
> Angelo Chen wrote:
>> 
>> Hi,
>> 
>> Zone has to be updated by an actionlink or a form, is there another way?
>> here is what I intend to use:
>> 
>> 1. when page is loaded:
>>    < t:zone t:id="content" show="slidedown" update="show" >Loading,
>> please wait.. < /t:zone>
>> 
>> 2. the template retrieves some other info from the server thru
>> ${moreInfo} which takes a longer time, I'd like this to go into the zone
>> above so it overwrites the 'loading, please wait...'
>> 
>> any hints to accomplish this? Thanks.
>> 
>> A.C.
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208606.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: updating a zone during loading of page?

Posted by Ville Virtanen <vi...@cerion.fi>.
Hi,

have looked into
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/ProgressiveDisplay.html
?

Maybe that solves it?

 - Ville


Angelo Chen wrote:
> 
> Hi,
> 
> Zone has to be updated by an actionlink or a form, is there another way?
> here is what I intend to use:
> 
> 1. when page is loaded:
>    < t:zone t:id="content" show="slidedown" update="show" >Loading, please
> wait.. < /t:zone>
> 
> 2. the template retrieves some other info from the server thru ${moreInfo}
> which takes a longer time, I'd like this to go into the zone above so it
> overwrites the 'loading, please wait...'
> 
> any hints to accomplish this? Thanks.
> 
> A.C.
> 
> 

-- 
View this message in context: http://old.nabble.com/t5%3A-updating-a-zone-during-loading-of-page--tp26208359p26208571.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org