I developed the same kind of component. Here's my code (nevermind the
'message' stuff):

<span jwcid="@If" condition="ognl:(delegate.hasErrors || message)">
<div class="errors" id="errors">

<ul>
<li jwcid="@Foreach" source="ognl:delegate.getErrorRenderers()"
value="ognl:error" element="li"><span jwcid="@Delegator"
delegate="ognl:error">error message here</span></li>
</ul>

</div>
</span>

You just call getErrorRenderers to get each of the IRender objects
(which just display strings by default).

On Mon, 2005-09-26 at 14:05 -0700, Patrick Casey wrote:
>       I've run into a situation where I have multiple levels of validation
> going on during a form submit;
> 
> 1) Form level validation (collected in an IValidationDelegate).
> 2) Metadata level validation (Collected in my own ErrorAggregator).
> 3) Database level validation (Collected in my own ErrorAggregator).
> 
> 
> I'd like to build one global "MessageBox" component that I can put on every
> form to display all three classes of error message together since the user
> neither knows, nor cares, which level of the application complained that
> "login cannot be blank".
> 
> Right now, I've got the MessageBox component up and running happily over my
> ErrorAggregator, and at the step where I want to push the errors from the
> Tapestry Validation Delegate into my ErrorAggregator (translating as
> necessary). I'm sort of stumped though.
> 
> So far I've gotten:
> 
> IValidationDelegate delegate = (IValidationDelegate) getBeans()
>                               .getBean("delegate");
>               if (delegate.getHasErrors()) {
>                       // what goes here?
>               }
> 
> I can get the delegate (no problem), but I can't seem to crack the nut to
> get at the error objects contained therein. Can anyone help me out here? 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]
> 
-- 
Dan Adams
Software Engineer
Interactive Factory


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

Reply via email to