Hi,

I believe you can achieve what you want by grabbing the ValidationTracker
from the Environment. The Form component pushes it to the environment during
beginRender and pops it in cleanupRender, your component will beginRender
after the form.

you would do something like:
@Inject
Environment _environment;
void beginRender() {
...
ValidationTracker tracker = _environment.peek(ValidationTracker.class);
tracker.getHasErrors();
}

I haven't run, or even compiled this code, and I'm still back in 5.0.6 so
perhaps something has changed, but I'm fairly certain it should work.

Good luck,
Josh

On Jan 30, 2008 9:11 AM, Xinhua <[EMAIL PROTECTED]> wrote:

>
> I create a custom component (AttrLable) which extends AbstractField. In
> the
> BeginRender(MarkupWriter writer), I will need to override the label tag
> based on whether there is an error in the input field which is associated
> to
> this label.
>
> On the form submission, I will do the form validation and if errors are
> found, I will highlight the label and input field in the form page. But
> the
> problem is how I can pass the error flag to the component class
> (Attrlabel)
> which will rend the component.
>
> Thanks in advance!
>
>
> Xinhua
> --
> View this message in context:
> http://www.nabble.com/Tapestry-5---Custom-Component-Validation-tp15186101p15186101.html
> Sent from the Tapestry - User mailing list archive at 
> Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Reply via email to