YFaces
  1. YFaces
  2. YFACES-24

component validation enhancements

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5
    • Fix Version/s: 0.6
    • Component/s: yfaces-core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently YComponent#validate just returns void.

      Validation can be improved in following ways:

      • YComponent#validate returns boolean
        -> true : validation successfull, proceed as usual
        -> false: validation fails; don't render component
        or
      • YComponent#validate returns void but method body may call YComponent#setValidationState(...) for an enhanced validation (error) result
      • YComponent#validate throws an exception
        -> don'r render component; log exception (console) but don't show it in browser

      Validation is very low level and only assures, that while rendering the component no exception is thrown/visible at browser.
      For a more accurate validation handling each component has to implement it and each component view has to evaluate it.

        Issue Links

          Activity

          Denny Strietzbaum made changes -
          Field Original Value New Value
          Description Currently YComponent#validate returns void.

          Validation can be improved in following ways:
          - YComponent#validate returns boolean
            -> true : validation successfull, proceed as usual
            -> false: validation fails; don't render component

          - YComponent#validate throws an exception
            -> don'r render component; log exception (console) but don't show it in browser

          Validation is very low level and only assures, that while rendering the component no exception is thrown/visible at browser.
          For a more accurate validation handling each component has to implement it and each component view has to evaluate it.
          Currently YComponent#validate just returns void.

          Validation can be improved in following ways:
          - YComponent#validate returns boolean
            -> true : validation successfull, proceed as usual
            -> false: validation fails; don't render component
          or
          - YComponent#validate returns void but method body may call YComponent#setValidationState(...) for an enhanced validation (error) result

          - YComponent#validate throws an exception
            -> don'r render component; log exception (console) but don't show it in browser

          Validation is very low level and only assures, that while rendering the component no exception is thrown/visible at browser.
          For a more accurate validation handling each component has to implement it and each component view has to evaluate it.
          Denny Strietzbaum made changes -
          Component/s yfaces-core [ 13667 ]
          Denny Strietzbaum made changes -
          Link This issue duplicates YFACES-23 [ YFACES-23 ]
          Hide
          Denny Strietzbaum added a comment -

          HtmlYComponent either renderes YComponent as expected or, when component returns an illegalComponentState, delegates to an internal renderer which just prints the illegalstate message but without break the rendering process of the whole UiViewroot.

          An illegalComponentState can be set manually within: YComponent#validate(), YComponent#refresh or within any component setter which gets invoked before validate.
          An illegalcomponentstate is set automatically whenever an uncaught exception within the above methods is thrown.

          Show
          Denny Strietzbaum added a comment - HtmlYComponent either renderes YComponent as expected or, when component returns an illegalComponentState, delegates to an internal renderer which just prints the illegalstate message but without break the rendering process of the whole UiViewroot. An illegalComponentState can be set manually within: YComponent#validate(), YComponent#refresh or within any component setter which gets invoked before validate. An illegalcomponentstate is set automatically whenever an uncaught exception within the above methods is thrown.
          Denny Strietzbaum made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 0.9 [ 14899 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 0.6 [ 15262 ]

            People

            • Assignee:
              Denny Strietzbaum
              Reporter:
              Denny Strietzbaum
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: