The validator:errors tag header and footer are
optional.  So you can do something like this below.

       <ul>
       <validator:errors id="error" property="name">
          <li><bean:write name="error"/></li>
       </validator:errors>
       </ul>

or 

    <validator:errorsExist property="name">
       <bean:message key="errors.header"/>
       <ul>
       <validator:errors id="error" property="name">
          <li><bean:write name="error"/></li>
       </validator:errors>
       </ul><hr>
    </validator:errorsExist>

Also in the nightly builds there is an html:messages
tag that works like validator:errors.  I will also be
checking in a logic:messagesPresent and
logic:messagesNotPresent in the next day or so into
the Struts Logic Tag Library.

    <logic:messagesPresent property="name">
       <bean:message key="errors.header"/>
       <ul>
       <html:messages id="error" property="name">
          <li><bean:write name="error"/></li>
       </html:messages>
       </ul><hr>
    </logic:messagesPresent>

David

--- Alexander  Jesse <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have a problem with the errors-tag.
> In my app I want to have a list of all errors on top
> of the page. In addition 
> each field in the form must have the specific errors
> close by.
> 
> Theoretically this is possible using the
> property-attribute of the error-tag.
> 
> But:
> The logic in the errors-tag will show the
> error-headers for each form-field 
> (as soon as one field has an error). This comes from
> the fact, that in the
> errors-tag source the decision whether to show or
> not the errors-list is made
> without any regards for the property-attribute. The
> actual error-messages though
> check for the property-attribute. So for fields
> without an error only the 
> error.header and .footer is shown with an empty
> space between...
> 
> 
> In the bugs-database I found no mentioning of this
> fact. That's why I wanted to
> check whether somebody is already working on this or
> not.
> 
> If nobody else is tackling it, I will try to develop
> a "correct" version and post 
> a proposed fix.
> 
> The same problem exists with the validator's
> errors-tag...
> 
> regards
> Alexander Jesse


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to