Through component responses, individual components may become valid or invalid by using the <validate> element. When a component is invalidated through a component response, only another component response may re-validate the component.
To validate and invalidate a component
<response> <invalidate-components strict="true"> <message>These are not valid values</message> <component id="ip-address" /> <component id="firewall" /> </invalidate-components> </response>
If the rule is met, the "ip-address" and "firewall" components are invalidated, and the user is shown the message "These are not valid values" and is prevented from proceeding.
<response> <validate-components strict="true"> <component id="ip-address" /> <component id="firewall" /> </validate-components> </response>
If the rule is met, the "ip-address" and "firewall" components are re-validated, and the user is allowed to proceed.
Because component rules can be dynamic, meaning they can be returned from the server, you may prefer to use them as opposed to existing validation framework. For example, you could have an external script verify that a username is valid, possibly invalidating the username component.
Related topics