Considérons ci-dessous, exemple simplifié:riche: TabPanel et les problèmes lorsque le champ est requis = « true »
Nous avons 2 onglets withing <rich:tabPanel switchType="ajax">
, chaque onglet a <h:inputText value="" required="true" />
et au moment nous voulons passer d'un onglet à une autre, et le inputText est vide (nous ne voulons pas présenter la valeur de toute façon, nous voulons aller dans un autre onglet) nous obtenons "Validation Error: Value is required."
le code exemple:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
>
<a4j:form id="mainForm"
reRender="mainForm"
ajaxSubmit="true">
<rich:tabPanel switchType="ajax">
<rich:tab label="TabA" >
<a4j:region>
<h:outputText value="Tab A content" />
<h:inputText value="" required="true" />
</a4j:region>
</rich:tab>
<rich:tab label="TabB">
<a4j:region>
<h:outputText value="Tab B content" />
<h:inputText value="" required="true" />
</a4j:region>
</rich:tab>
</rich:tabPanel>
<rich:messages />
</a4j:form>
</html>
grâce, c'est résout le problème :-) – JQueryNeeded