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

 

Reply via email to