[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: t5 class cast
From:       "Davor Hrg" <hrgdavor () gmail ! com>
Date:       2008-01-23 9:32:19
Message-ID: 84d1dff00801230132w189c584ax5dca5172f60934d5 () mail ! gmail ! com
[Download RAW message or body]

Class cast exceptions happen
if you have non component classes inside components or pages packages...

post some code and say what packages are those classes in...

Davor Hrg

On Jan 23, 2008 10:12 AM, riccaruf
<riccardo.ruffilli@mapsengineering.com> wrote:
>
> Hi Dave thank you very mutch for your reply!! Oops..what I dummy I am! I miss
> something in the post preview :-(( , and
> Yes yes my test was exactly in the way you write....
>
>     if (field instanceof MyInput)....
>
> But it doesn't work!
>
> The log messages show me that the instance tapestry pass me as parameter
> is of my class but it seems not recognize it. Seems that the "instance of"
> can't work in the right way!
> Is t5 class loader different in anything from the other?
> Is because we can not instance directly a component so we can not access in
> any way
> to its class ?
>
> I've triyed also the downcast but obvously a class cast explode on my
> monitor ;).
>
> Please tell me what should happen... I can not understand.
>
> cheers
>
> -Rick
>
>
>
>
> Dave.Derry wrote:
> >
> > I think your test is wrong. Don't you want
> >
> >                          if (field instanceof MyInput){
> > ?
> >
> > Dave
> >
> > We must begin not just to act, but to think, for there is no better slave
> > than the one who believes his slavery to be freedom, and we are in
> > no greater peril than when we cannot see the chains on our minds
> > because there are yet no chains on our feet.
> > -- Michael Reid
> >
> >
> >
> >
> >
> >              riccaruf
> >              <riccardo.ruffill
> >              i@mapsengineering                                          To
> >              .com>                     users@tapestry.apache.org
> >                                                                         cc
> >              01/22/2008 12:09
> >              PM                                                    Subject
> >                                        t5 class cast
> >
> >              Please respond to
> >              "Tapestry users"
> >              <users@tapestry.a
> >                 pache.org>
> >
> >
> >
> >
> >
> >
> >
> > Hi everybody, I've got this kind of method in my validator class
> >
> >     public void render(Field field, Void constraintValue, MessageFormatter
> > formatter, MarkupWriter writer,
> >             FormSupport formSupport) {
> >
> >                          System.out.println("### field:"+field);
> >                          Field inputField=field;
> >                          if (field instanceof SailingInput){
> >                                      MyInput si=(MyInput)field;
> >                                      inputField=si.get();
> >                          }
> >                          formSupport.addValidation(inputField, "test",
> > buildMessage(formatter,
> > field), null);
> >              }
> >
> > this is the output
> >
> > ### field:it.myapp.web.components.MyInput@127a1d8
> > but the cast has never done.
> > Any ideas ?
> >
> > thanks in advance.
> >
> > -Rick
> >
> > --
> > View this message in context:
> > http://www.nabble.com/t5-class-cast-tp15023351p15023351.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
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/t5-class-cast-tp15023351p15037536.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
>
>

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic