# <rich:graphValidator> usage

In that sampe <rich:graphValidator> component appends JSR-299 or Hibernate validators to all enclosed input components that check restrictions for field values, and, in addition, validates whole bean.

JSF bean fields are annotated with @Min/@Max restrictions and getter for the 'total' attribute is also annotated by the @Max

As a result, even valid field values would make whole bean an invalid. For example, values '2','7','15' are valid for fields values but their sum exceed maximum total value '20'

Validator assignes new values to a cloned bean instance hence model is not updated with invalid values.