You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jun Tsai <ju...@gmail.com> on 2008/05/07 06:51:39 UTC

How to instance object using generic method?

public class GenericCreatePage<T>{
 private T entity;
 void onSuccess(){
   orm.save(entity);
 }
 public void setter/getter
}


public class CreateUser exntends GenericCreatePage<User>{
   void onActivate(){
     // Must  instance the entity object.How to avoid or using generic
method?
     setEntity(new User());

   }
}


thanks



-- 
regards,
Jun Tsai

Re: Referring ComponentResources blows Component

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi Marting,

if you post your code we'll more likley be able to help you :)

injecting ComponentResources does not cause any problems/
sideeffects for me either. as long as you use it only in pages,
components and mixins :) 

g,
kris





"Filip S. Adamsen" <fs...@fsadev.com> 
07.05.2008 14:00
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
Tapestry users <us...@tapestry.apache.org>
Kopie

Thema
Re: Referring ComponentResources blows Component







Hi,

I use ComponentResources all the time with no issues whatsoever. 
Something else must be wrong. Do you have any code to share?

-Filip

On 2008-05-07 09:18, Martin Kersten wrote:
> Hi there,
> 
>    I stumbled across a deal breaker problem. I have a simple login 
> component and and embedded a Form to it (using <t:form>). 
> 
> * OnSuccess I tried to set an ASO (which was present but changes 
> to it are not stored). So I tried using the ApplicationStateManager 
> which was Present but also didn't stored the change (Debugger 
> ensured the change within the ASO is present.
> 
> * Since this component also works using actions (Development mode)
>   I tried using ComponentResources and use createAction link and
>   return this within the OnSuccess method here the most funkiest
>   things happend.
> 
>   -> Everytime I add the type ComponentResources to the component
>      (in what conjunction ever: inject, reference, adding 
>       method parameters etc.) the component blows and tapestry 
>       reports Login component NoClassDefFoundError
> 
> StackTrace of the root cause:
> Caused by: java.lang.NoClassDefFoundError: com/[...]/Login
>                at java.lang.Class.getDeclaredMethods0(Native Method)
>                at 
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
>                at java.lang.Class.getDeclaredMethods(Class.java:1791)
>                at java.beans.Introspector$1.run(Introspector.java:1272)
>                at java.security.AccessController.doPrivileged(Native 
Method)
>                at
> java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
>                at
> java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
>                at 
java.beans.Introspector.getBeanInfo(Introspector.java:387)
>                at 
java.beans.Introspector.getBeanInfo(Introspector.java:159)
>                at org.apache.tapestry.ioc.internal.services.
> PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:85)
>                ... 71 more
> 
>   I: So whats wrong with this? 
>  II: Is using ComponentResources is forbidden When embedding a form? 
> III: Is the ASO distracted by OnSuccess?
>  IV: Do I misuse something?
> 
> Thanks,
> 
> Martin(Kersten)
> 
> PS: Emigrated to 5.0.11 already, problem was notified with 5.0.10.
> PSS: What an unexpected deal breaker!
> 
> ---------------------------------------------------------------------
> 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: Referring ComponentResources blows Component

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

I use ComponentResources all the time with no issues whatsoever. 
Something else must be wrong. Do you have any code to share?

-Filip

On 2008-05-07 09:18, Martin Kersten wrote:
> Hi there,
> 
>    I stumbled across a deal breaker problem. I have a simple login 
> component and and embedded a Form to it (using <t:form>). 
> 
> * OnSuccess I tried to set an ASO (which was present but changes 
> to it are not stored). So I tried using the ApplicationStateManager 
> which was Present but also didn't stored the change (Debugger 
> ensured the change within the ASO is present.
> 
> * Since this component also works using actions (Development mode)
>   I tried using ComponentResources and use createAction link and
>   return this within the OnSuccess method here the most funkiest
>   things happend.
>   
>   -> Everytime I add the type ComponentResources to the component
>      (in what conjunction ever: inject, reference, adding 
>       method parameters etc.) the component blows and tapestry 
>       reports Login component NoClassDefFoundError
> 
> StackTrace of the root cause:
> Caused by: java.lang.NoClassDefFoundError: com/[...]/Login
> 	at java.lang.Class.getDeclaredMethods0(Native Method)
> 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
> 	at java.lang.Class.getDeclaredMethods(Class.java:1791)
> 	at java.beans.Introspector$1.run(Introspector.java:1272)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
> 	at
> java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
> 	at java.beans.Introspector.getBeanInfo(Introspector.java:387)
> 	at java.beans.Introspector.getBeanInfo(Introspector.java:159)
> 	at org.apache.tapestry.ioc.internal.services.
> PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:85)
> 	... 71 more
> 
>   I: So whats wrong with this? 
>  II: Is using ComponentResources is forbidden When embedding a form? 
> III: Is the ASO distracted by OnSuccess?
>  IV: Do I misuse something?
> 
> Thanks,
> 
> Martin(Kersten)
> 
> PS: Emigrated to 5.0.11 already, problem was notified with 5.0.10.
> PSS: What an unexpected deal breaker!
> 
> ---------------------------------------------------------------------
> 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


Referring ComponentResources blows Component

Posted by Martin Kersten <Ma...@mercateo.com>.
Hi there,

   I stumbled across a deal breaker problem. I have a simple login 
component and and embedded a Form to it (using <t:form>). 

* OnSuccess I tried to set an ASO (which was present but changes 
to it are not stored). So I tried using the ApplicationStateManager 
which was Present but also didn't stored the change (Debugger 
ensured the change within the ASO is present.

* Since this component also works using actions (Development mode)
  I tried using ComponentResources and use createAction link and
  return this within the OnSuccess method here the most funkiest
  things happend.
  
  -> Everytime I add the type ComponentResources to the component
     (in what conjunction ever: inject, reference, adding 
      method parameters etc.) the component blows and tapestry 
      reports Login component NoClassDefFoundError

StackTrace of the root cause:
Caused by: java.lang.NoClassDefFoundError: com/[...]/Login
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
	at java.lang.Class.getDeclaredMethods(Class.java:1791)
	at java.beans.Introspector$1.run(Introspector.java:1272)
	at java.security.AccessController.doPrivileged(Native Method)
	at
java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
	at
java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
	at java.beans.Introspector.getBeanInfo(Introspector.java:387)
	at java.beans.Introspector.getBeanInfo(Introspector.java:159)
	at org.apache.tapestry.ioc.internal.services.
PropertyAccessImpl.buildAdapter(PropertyAccessImpl.java:85)
	... 71 more

  I: So whats wrong with this? 
 II: Is using ComponentResources is forbidden When embedding a form? 
III: Is the ASO distracted by OnSuccess?
 IV: Do I misuse something?

Thanks,

Martin(Kersten)

PS: Emigrated to 5.0.11 already, problem was notified with 5.0.10.
PSS: What an unexpected deal breaker!

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


Re: How to instance object using generic method?

Posted by "Filip S. Adamsen" <fs...@fsadev.com>.
Hi,

This is not possible due to the way Java generics are implemented. At 
least not at present.

-Filip

On 2008-05-07 06:51, Jun Tsai wrote:
> public class GenericCreatePage<T>{
>  private T entity;
>  void onSuccess(){
>    orm.save(entity);
>  }
>  public void setter/getter
> }
> 
> 
> public class CreateUser exntends GenericCreatePage<User>{
>    void onActivate(){
>      // Must  instance the entity object.How to avoid or using generic
> method?
>      setEntity(new User());
> 
>    }
> }
> 
> 
> thanks
> 
> 
> 

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