1 Reply Latest reply on Jun 13, 2008 5:40 PM by sergeysmirnov

    Turning Off Validations on Ajax Submits

      I am developing a RichFaces-Seam application. I have a page with 4 <s:div> tags that are mutually exclusive, so only one of them is rendered on the basis of a radio button selection. In other words, when a radio button is clicked, an ajax request is made to update the model, and a single div corresponding to that selection gets rendered as a result.

      The problem is when I add validation within the divs in the form of required="true". When this is present, and I go to click on the radio button, the validations kick in because they happen before the model is updated in the JSF lifecycle. As a result, I see the error messages, and although the new radio button is selected, the corresponding div does not appear. The previous one remains.

      In a conceptual sense, I basically want to distinguish between an Ajax submit and a synchronous submit and have the validation kick in only in the latter case.

      Any insight into how to accomplish this is appreciated.

      Thanks.