You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Captain Cid <ca...@indiatimes.com> on 2009/12/30 13:17:14 UTC
Passing object as paramters to component
I want to pass an object to component. Components renders from data from this
object.
I tried doing an environment push of component but tapestry gives error
"java.lang.ClassNotFoundException: caught an exception while obtaining a
class file" .
It seems only component classes can be pushed into environment..and not
normal classes.
--
View this message in context: http://old.nabble.com/Passing-object-as-paramters-to-component-tp26966814p26966814.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Passing object as paramters to component
Posted by Ville Virtanen <vi...@cerion.fi>.
Hi,
define private YourObjectType param; variable to your component class and
use it. Annotate it with @Parameter annotation.
Then use your component like this: <t:myComponent
t:param="prop:paramGetterSetterInPageClass" />
Or read the documentation:
http://tapestry.apache.org/tapestry5/guide/parameters.html
- Ville
Captain Cid wrote:
>
> I want to pass an object to component. Components renders from data from
> this object.
>
> I tried doing an environment push of component but tapestry gives error
> "java.lang.ClassNotFoundException: caught an exception while obtaining a
> class file" .
>
> It seems only component classes can be pushed into environment..and not
> normal classes.
>
--
View this message in context: http://old.nabble.com/Passing-object-as-paramters-to-component-tp26966814p26966920.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Passing object as paramters to component
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 30 Dec 2009 10:17:14 -0200, Captain Cid
<ca...@indiatimes.com> escreveu:
> I want to pass an object to component. Components renders from data from
> this object.
Just use @Component as Ville suggested.
> I tried doing an environment push of component but tapestry gives error
> "java.lang.ClassNotFoundException: caught an exception while obtaining a
> class file" .
Why are you using the Environment for that?
Anyway, post the full stack trace so we can undestand it better.
> It seems only component classes can be pushed into environment..and not
> normal classes.
That's not correct. By the way, I've never seen a component instance being
pushed in the environment.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da
Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org