Hi Patrick Casey,
                 yes it is the way in 3.0.3. but after you get the list of
field trakings instead of for loop get java.util.Iterator from the
java.util.List it might be an easy way.


Muralidhar Y
Software Engineer,
Adastrum technologies-Nikai groups,
EmiratesGroup-I.T Division,
Dubai, UAE.
Mobile : 00971-50-2256149.
http://www.adastrumtech.com
http://www.mercator.aero  
(Keep Smiling. Be happy All The Time.)

-----Original Message-----
From: Patrick Casey [mailto:[EMAIL PROTECTED] 
Sent: 27 September 2005 02:19
To: 'Tapestry users'
Subject: RE: Working with Validation Delegates in Code


        Sorry to be dense here, but I'm not seeing a getErrorRenderers()
method in the IValidationDelegate interface. Is that something that went
into tapestry 4.0? I'm still on 3.0.3.

        I think I found a 3.0.3 way of doing it, but I'm not super happy
about it.

                IValidationDelegate delegate = (IValidationDelegate)
getBeans()
                                .getBean("delegate");
                if (delegate.getHasErrors()) {
                        Visit v = (Visit) getPage().getVisit();

                        List l = delegate.getFieldTracking();
                        for (int x=0; x< l.size(); x++) {
                                Object o = l.get(x);
                                FieldTracking f = (FieldTracking) o;
                                if (f.getErrorRenderer() != null) {
        
v.getMessageQueue().addError(f.getErrorRenderer().toString());
                                }

                        }
                }

> -----Original Message-----
> From: Filip S. Adamsen [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 26, 2005 2:17 PM
> To: Tapestry users
> Subject: Re: Working with Validation Delegates in Code
> 
> Doh, sorry - I meant IRender#toString()... :$
> 
> -Filip
> 
> Filip S. Adamsen wrote:
> > Hmm, you could query IValidationDelegate#getErrorRenderers() and 
> > call
> > IRender#getString() on each object in the returned list to get the 
> > error messages?
> >
> > -Filip
> >
> > Patrick Casey wrote:
> >  > All
> >
> >> I really want are the error strings; my error rendering will take 
> >> care
> of
> >> formatting and rendering them, but I need to know the text to render.
> >>
> >>     Suggestions?
> >>
> >>     --- Pat



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to