You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2007/08/20 11:59:34 UTC

[jira] Updated: (STR-1525) Enhanced Error Handling & Style Control

     [ https://issues.apache.org/struts/browse/STR-1525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Benedict updated STR-1525:
-------------------------------

    Fix Version/s: Future
         Assignee:     (was: Struts Developers)

> Enhanced Error Handling & Style Control
> ---------------------------------------
>
>                 Key: STR-1525
>                 URL: https://issues.apache.org/struts/browse/STR-1525
>             Project: Struts 1
>          Issue Type: Improvement
>          Components: Taglibs
>    Affects Versions: Nightly Build
>         Environment: Operating System: All
> Platform: All
>            Reporter: Jonathan R. DeRose
>            Priority: Minor
>             Fix For: Future
>
>         Attachments: LabelTag.java, LabelTag.java, LabelTag.java, style_control_complete_report.txt, updated_error_handling_diff_report.txt
>
>
> This enhancement allows users to set up default styles (style, styleClass, 
> styleId, errorStyle, errorStyleClass, errorStyleId) in a resource bundle (Ex: 
> ApplicationResources.properties).
> When an input element is rendered a check is made to see if any errors are 
> associated with it.  If errors are associated the tag will use any error-styles 
> assigned to it, otherwise it will use the non-error-styles.  (Ex: A developer 
> can set an errorStyleClass that will highlight text inputs with errors in red.)
> A new tag (LabelTag) is also included in this enhancement.  LabelTags are 
> associated with input elements.  It will apply different styles to its body 
> content in the same fashion as the input elements.  (Ex: A normal black label 
> can turn red and bold if its input fails validation.)
> Basic behavior for this enhancment:
> * Styles/error-styles assigned in-line override their counterparts in the 
> resource bundle.
> * Non error-styles will be used regardless of errors if error-styles are not 
> assigned. (Ex: If you set the styleClass and not the errorStyleClass it will 
> use the styleClass regardless of errors.)
> * Error-styles will only be used if errors are associated with the element. 
> (Ex: If you set the errorStyleClass and not the styleClass it will only use the 
> errorStyleClass when errors are associated.)
> * Errors can be associated with specific input elements, groups of elements, or 
> both.
> EXAMPLE:
> ====== ApplicationResources.properties =====
> ...
> label.errorStyleClass=bold
> ...
> text.styleClass=normal
> text.errorStyleClass=red_error
> ...
> ===== test.jsp =====
> ...
> <html:label group="name">Name:</html:label>
> <html:text property="firstName" group="name"/>
> <html:text property="lastName" group="name"/>
> ...
> <html:label group="ssn">SSN:</html:label>
> <html:text property="ssn1" group="ssn" errorStyleClass="blue_error"/>
> <html:text property="ssn2" group="ssn" errorStyleClass="blue_error"/>
> <html:text property="ssn3" group="ssn" errorStyleClass="blue_error"/>
> ...
> ===== output with no errors =====
> ...
> Name:
> <input type="text" name="firstName" class="normal">
> <input type="text" name="lastName" class="normal">
> ...
> SSN:
> <input type="text" name="ssn1" class="normal">
> <input type="text" name="ssn2" class="normal">
> <input type="text" name="ssn3" class="normal">
> ...
> ===== output with error on name and ssn ===
> ...
> <span class="bold">Name:</span>
> <input type="text" name="firstName" class="red_error">
> <input type="text" name="lastName" class="red_error">
> ...
> <span class="bold">SSN:</span>
> <input type="text" name="ssn1" class="blue_error">
> <input type="text" name="ssn2" class="blue_error">
> <input type="text" name="ssn3" class="blue_error">
> ...
> ===== output with error on lastName =====
> ...
> Name:
> <input type="text" name="firstName" class="normal">
> <input type="text" name="lastName" class="red_error">
> ...
> SSN:
> <input type="text" name="ssn1" class="normal">
> <input type="text" name="ssn2" class="normal">
> <input type="text" name="ssn3" class="normal">
> ...
> This ticket is an enhancement of a previous ticket and replaces STR-1510
> http://issues.apache.org/bugzilla/show_bug.cgi?id=20630

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.