Java Mailing List Archive

http://www.gg3721.com/

Home » users.tapestry »

T5: @Propery can not be an Interface? No default coercion?

Maximilian Weißböck

2008-11-26

Replies: Find Java Web Hosting

Author LoginPost Reply
I have a component that has a delegate as parameter binding like this:



 @Parameter("false")

 @Property

 private PageDelegate pageDelegate;



Inside the page I'm testing if the delegate is set (only then an ActionLink will be shown)



 <t:if test="pageDelegate">





PageDelegate is an Interface, and I'm getting this error on startup:



[ERROR] ipeople.Index Render queue error in BeginRender[ipeople/Index:iphonelistlayout.if_0]: Failure reading parameter 'test' of component ipeople/Index:iphonelistlayout.if_0: Failure reading parameter 'pageDelegate' of component ipeople/Index:iphonelistlayout: Could not find a coercion from type java.lang.Boolean to type at.sphinx.sxfinder.util.PageDelegate. Available coercions: Double --> Float, Float --> Double, Long --> Boolean, Long --> Byte, Long --> Double, Long --> Integer, Long --> Short, Number --> Long, Object --> Object[], Object --> String, ... [deleted]



Everything works fine if I change pageDelegate to type Object, as there is a default coercion for Object.

Now what I would like is the exact same behaviour for an Interface as it is for Object (test returns true if not null, false if null)



Is there e generic way to do this, or even better could that be standard behaviour in T5?

Anything that is against this possible standard behaviour?





And a second question:



What I'm doing with this PageDelegate is to give the Component access to the Page it is contained in.

Is there a better/standard way to do this?



Thanks, Max



©2008 gg3721.com - Jax Systems, LLC, U.S.A.