You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Dukaczewski <m....@tu-bs.de> on 2009/05/05 21:54:19 UTC

automatic zone update

I'm trying to create a zone which automatically updates itself after
some time. Any suggestions?


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


Re: automatic zone update

Posted by Michael Dukaczewski <m....@tu-bs.de>.
That is exactly what I was looking for. Thank you!
This mailing list is great.


Andy Pahne schrieb:
> 
> Tapestry 5.1 has this lazy loading included as component: check the
> ProgressiveDisplay component.
> 
> Andy
> 
> 
> 
> Alfie Kirkpatrick schrieb:
>> I made a simple "LazyZone" component which ajax loads the zone after the
>> page load. Should be simple enough to add a timer to it. You provide a
>> block as a parameter to the component...
>>
>> LazyZone.java
>> -------------
>> @IncludeJavaScriptLibrary("lazyZone.js")
>> public class LazyZone extends Zone {
>>     @Parameter
>>     private Block content;
>>     
>>     @Inject
>>     private ComponentResources resources;
>>     
>>     @Environmental
>>     private RenderSupport renderSupport;
>>     
>>     @AfterRender
>>     void renderCallback() {
>>         // generate a link which when used client side will
>> invoke event handler below
>>         Link link = resources.createEventLink("provideContent");
>>         // get tapestry to initialise us client side
>>         renderSupport.addInit("lazyZoneLoad", getClientId(),
>> link.toURI());
>>     }
>>     
>>     public Object onProvideContent() {
>>         // return the block which was passed as parameter,
>> tapestry
>>         // will render it for us
>>         return content;
>>     }
>> }
>>
>> lazyZone.js
>> -----------
>> Tapestry.Initializer.lazyZoneLoad = function(element, url) {
>>     $T(element).zoneManager.updateFromURL(url);
>> }
>>
>>
>> HTH
>> Alfie.
>> -----Original Message-----
>> From: Michael Dukaczewski [mailto:m.dukaczewski@tu-bs.de] Sent: 05 May
>> 2009 20:54
>> To: Tapestry users
>> Subject: automatic zone update
>>
>> I'm trying to create a zone which automatically updates itself after
>> some time. Any suggestions?
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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

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


Re: automatic zone update

Posted by Andy Pahne <an...@gmail.com>.
Tapestry 5.1 has this lazy loading included as component: check the 
ProgressiveDisplay component.

Andy



Alfie Kirkpatrick schrieb:
> I made a simple "LazyZone" component which ajax loads the zone after the
> page load. Should be simple enough to add a timer to it. You provide a
> block as a parameter to the component...
>
> LazyZone.java
> -------------
> @IncludeJavaScriptLibrary("lazyZone.js")
> public class LazyZone extends Zone {
> 	@Parameter
> 	private Block content;
> 	
> 	@Inject
> 	private ComponentResources resources;
> 	
> 	@Environmental
> 	private RenderSupport renderSupport;
> 	
> 	@AfterRender
> 	void renderCallback() {
> 		// generate a link which when used client side will
> invoke event handler below
> 		Link link = resources.createEventLink("provideContent");
> 		// get tapestry to initialise us client side
> 		renderSupport.addInit("lazyZoneLoad", getClientId(),
> link.toURI());
> 	}
> 	
> 	public Object onProvideContent() {
> 		// return the block which was passed as parameter,
> tapestry
> 		// will render it for us
> 		return content;
> 	}
> }
>
> lazyZone.js
> -----------
> Tapestry.Initializer.lazyZoneLoad = function(element, url) {
> 	$T(element).zoneManager.updateFromURL(url);
> }
>
>
> HTH
> Alfie. 
>
> -----Original Message-----
> From: Michael Dukaczewski [mailto:m.dukaczewski@tu-bs.de] 
> Sent: 05 May 2009 20:54
> To: Tapestry users
> Subject: automatic zone update
>
> I'm trying to create a zone which automatically updates itself after
> some time. Any suggestions?
>
>
>
> ---------------------------------------------------------------------
> 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: automatic zone update

Posted by Alfie Kirkpatrick <Al...@ioko.com>.
I made a simple "LazyZone" component which ajax loads the zone after the
page load. Should be simple enough to add a timer to it. You provide a
block as a parameter to the component...

LazyZone.java
-------------
@IncludeJavaScriptLibrary("lazyZone.js")
public class LazyZone extends Zone {
	@Parameter
	private Block content;
	
	@Inject
	private ComponentResources resources;
	
	@Environmental
	private RenderSupport renderSupport;
	
	@AfterRender
	void renderCallback() {
		// generate a link which when used client side will
invoke event handler below
		Link link = resources.createEventLink("provideContent");
		// get tapestry to initialise us client side
		renderSupport.addInit("lazyZoneLoad", getClientId(),
link.toURI());
	}
	
	public Object onProvideContent() {
		// return the block which was passed as parameter,
tapestry
		// will render it for us
		return content;
	}
}

lazyZone.js
-----------
Tapestry.Initializer.lazyZoneLoad = function(element, url) {
	$T(element).zoneManager.updateFromURL(url);
}


HTH
Alfie. 

-----Original Message-----
From: Michael Dukaczewski [mailto:m.dukaczewski@tu-bs.de] 
Sent: 05 May 2009 20:54
To: Tapestry users
Subject: automatic zone update

I'm trying to create a zone which automatically updates itself after
some time. Any suggestions?



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


Re: automatic zone update

Posted by Julian Wood <wo...@ucalgary.ca>.
I would check out Tapestry.activateZone (https://issues.apache.org/jira/browse/TAP5-569 
) and javascript's setInterval method (or prototype's  
PeriodicalExector). J

On May 5, 2009, at 1:54 PM, Michael Dukaczewski wrote:

> I'm trying to create a zone which automatically updates itself after
> some time. Any suggestions?


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