You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andrey Etush <an...@sentrigo.com> on 2010/03/15 16:06:06 UTC

Component used in 2 different pages and have method getParentPage

Hi, I have a problem.
I have dialog that used in 2 pages each page implements Interface
"CommonPage"
in component I have getParentPage that returns "CommonPage"
When I switch pages I have cast exception : $Page1 cannot be cast to
com.mycompany.Page2
what could be the problem?

Re: Component used in 2 different pages and have method getParentPage

Posted by Ulrich Stärk <ul...@spielviel.de>.
Tapestry pages can't just be casted to individual page instances because they are dynamically 
enhanced. Cast them to their interface type or @InjectPage them.

Uli

On 15.03.2010 16:06, Andrey Etush wrote:
> Hi, I have a problem.
> I have dialog that used in 2 pages each page implements Interface
> "CommonPage"
> in component I have getParentPage that returns "CommonPage"
> When I switch pages I have cast exception : $Page1 cannot be cast to
> com.mycompany.Page2
> what could be the problem?
>

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