Cancel validation on rich:tabPanel switch
jsf, jsf-2, richfaces
Solution
Add `immediate="true"` to the whole `rich:tabPanel`, or to individual `rich:tab` elements.
immediate
Flag indicating that this component's value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until Process Validations phase.
Problem
i try to create a unified login/register-page. We use a TabPanel for this. One tab to register, the other to login. The user should select what to do and then fill the inputs. The problem ist: the registration has many required inputs. Therefore, if you want to switch from registration-tab to login-tab the validator strikes and prints error messages about the non-filled inputfiels. Is there a way to disable the validation on tab-switching or to deligate vefification to a bean-function. in this function i could validate by myself according to the selected tab. Any ideas? ``` <h:form> //some inputs <rich:tabPanel id="panelRegisterLogin" switchType="server" activeItem="#{bean.registerLoginStatus}" itemChangeListener="#{bean.updateRegisterLoginStatus}"> <rich:tab header="logIn" id="logIn" name="logIn"> //inputs to log in an existing user </rich:tab> <rich:tab header="Register" id="registerNow" name="registerNow"> //inputs to register a new user connected to managed bean //some of them are required="true" </rich:tab> </rich:tabPanel> //submit-button </h:form> ```