rich:tabPanel and problems when filed has required="true"
Posted
by JQueryNeeded
on Stack Overflow
See other posts from Stack Overflow
or by JQueryNeeded
Published on 2010-03-25T18:39:16Z
Indexed on
2010/03/25
18:43 UTC
Read the original article
Hit count: 415
Hello,
Let's consider following, simplified example:
we have 2 tabs withing , each tab has and at the moment we want to switch from one tab to another, and the inputText is empty (we dont want to submit value from it anyway, we want to go to another tab) we get "Validation Error: Value is required."
the example code:
<!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>
© Stack Overflow or respective owner