tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davor Hrg (JIRA)" <...@tapestry.apache.org>
Subject [jira] Commented: (TAPESTRY-2289) Generic support does not handle onActivate
Date Fri, 21 Mar 2008 10:15:45 GMT

    [ https://issues.apache.org/jira/browse/TAPESTRY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581048#action_12581048
] 

Davor Hrg commented on TAPESTRY-2289:
-------------------------------------

simple generics support was added to PropertyConduit only,
so it works only for binding expressions.

onPassivate works because it does not have to be generic,
ValueEncoders will handle values returned based on actual type.

> Generic support does not handle onActivate
> ------------------------------------------
>
>                 Key: TAPESTRY-2289
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2289
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.12
>            Reporter: Angelo Chen
>            Priority: Minor
>
> Hi, 
> I'm trying out generic in 5.0.11, I have a base class ObjectEdit, then 
> public class ObjectEdit<T> { 
>     private T object; 
>     public T getObject() { return object;} 
>     public void setObject(T object) { this.object = object;} 
>     public void onActivate(T obj) { object = obj;} 
>     public T onPassivate() { return object; } 
> } 
> I was hoping that I can just extend it like this: 
> public class UserEdit extends ObjectEdit <Usr> { 
> } 
> but it does not work, error: 
> org.apache.tapestry.ioc.internal.util.TapestryException 
> Failure reading parameter 'object' of component admin/UserEdit:object: java.lang.String

> I have to do: 
> public class UserEdit extends ObjectEdit <User> { 
>      public void onActivate(User obj) { 
>         this.setObject(obj); 
>     } 
> } 
> and remove the onActivate from ObjectEdit, why onActivate does not work in a base class
when onPassivate can? Thanks, 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message