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                                             
>              [EMAIL PROTECTED]                                          To 
>              .com>                     users@tapestry.apache.org           
>                                                                         cc 
>              01/22/2008 12:09                                              
>              PM                                                    Subject 
>                                        t5 class cast                       
>                                                                            
>              Please respond to                                             
>              "Tapestry users"                                              
>              <[EMAIL PROTECTED]                                             
>                 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:[EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to