Re: classloader issues casting objects to their tapestry type

2012-03-07 Thread Lance Java
Thiago is correct in that the @HeartbeatDeferred annotation will only work in components. I think you might be able to achieve the same thing doing the following: @Inject Environment environment; Heartbeat heartbeat = environment.peek(Heartbeat.class); heartbeat.defer(new Runnable()) { public

Re: classloader issues casting objects to their tapestry type

2012-03-06 Thread Paul Stanton
I've found this is only a problem when you don't specify the zone's clientId in the tml: ${theTime} will work with @InjectComponent private Zone myZone; void onMyEvent() { ajaxResponseRenderer.addRender(myZone); } .. and this is well documented: http://tapestry.apache.org/ajax-components

Re: classloader issues casting objects to their tapestry type

2012-03-06 Thread Paul Stanton
Actually, ajaxResponseRenderer.addRender("myZone", myZone); still doesn't work completely as it puts a 'myZone' inside of the original 'myZone', therefore the only workable solution with zone injection: ajaxResponseRenderer.addRender("myZone", myZone.getBody()); which is no more reli

Re: classloader issues casting objects to their tapestry type

2012-03-06 Thread Paul Stanton
Oh, hang on... I've just tried out what I ASSUMED was the 'recommended' way of performing zone updates via AjaxResponseRenderer: @InjectComponent private Zone myZone; void onMyEvent() { ajaxResponseRenderer.addRender(myZone); } ... and this doesn't work either! I get an error on the clie

Re: classloader issues casting objects to their tapestry type

2012-03-05 Thread Thiago H. de Paula Figueiredo
On Mon, 05 Mar 2012 16:27:30 -0300, Paul Stanton wrote: Well it seems to be working (multiple times, so it's finding the zone/component to render) as is, however I'd prefer to implement something that should work rather than something that just happens to work! If the component isn't i

Re: classloader issues casting objects to their tapestry type

2012-03-05 Thread Paul Stanton
Well it seems to be working (multiple times, so it's finding the zone/component to render) as is, however I'd prefer to implement something that should work rather than something that just happens to work! Is lance's suggestion regarding @HeartbeatDeferred a better idea? I can't figure out ho

Re: classloader issues casting objects to their tapestry type

2012-03-05 Thread Thiago H. de Paula Figueiredo
On Sun, 04 Mar 2012 20:25:12 -0300, Paul Stanton wrote: On 29/02/2012 12:13 AM, Thiago H. de Paula Figueiredo wrote: No, you're using the t:id (server-side Tapestry component id) to retrieve the component, so it may not have its clientId set yet. Thiago, Hi! If I'm using the server

Re: classloader issues casting objects to their tapestry type

2012-03-05 Thread Lance Java
Download the tapestry source and take a look at how the label component works. The label component usually appears before the component it is labelling and therefore needs to use @HeartbeatDeferred to get it's associated component's clientId at the end of the heartbeat. On Sunday, 4 March 2012, Pa

Re: classloader issues casting objects to their tapestry type

2012-03-04 Thread Paul Stanton
On 29/02/2012 12:13 AM, Thiago H. de Paula Figueiredo wrote: No, you're using the t:id (server-side Tapestry component id) to retrieve the component, so it may not have its clientId set yet. Thiago, If I'm using the server-side tapestry component id, than what I'm doing is still wrong and

Re: classloader issues casting objects to their tapestry type

2012-02-28 Thread Thiago H. de Paula Figueiredo
On Tue, 28 Feb 2012 08:48:28 -0300, Paul Stanton wrote: Thanks Thiago, I wasn't fully aware of the 'controlled package' concept, however it does make sense. :) I tried casting to 'ClientBodyElement' and while the cast works, I found the zone update does not succeed since at that point t

Re: classloader issues casting objects to their tapestry type

2012-02-28 Thread Paul Stanton
Thanks Thiago, I wasn't fully aware of the 'controlled package' concept, however it does make sense. I tried casting to 'ClientBodyElement' and while the cast works, I found the zone update does not succeed since at that point the object has not been assigned a clientId. I find this strange si

Re: classloader issues casting objects to their tapestry type

2012-02-28 Thread Thiago H. de Paula Figueiredo
On Tue, 28 Feb 2012 06:40:41 -0300, Paul Stanton wrote: Hi Tapestry committers/experts (in particular) Hi! Please take note of the method "idealImplementation". This is how I expected to be able to implement the functionality, however a ClassCastException is thrown casting the Componen

classloader issues casting objects to their tapestry type

2012-02-28 Thread Paul Stanton
Hi Tapestry committers/experts (in particular) I while back I posted that I had found a classloader issue within one of my services when casting a Zone to a Zone. I realise that what I'm trying to do isn't quite the 'tapestry recommended approach', but since some of my pages update many zones