Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jsf-使用primefaces对未处理的输入进行验证失败_Java_Jsf_Jsf 2_Primefaces - Fatal编程技术网

Java jsf-使用primefaces对未处理的输入进行验证失败

Java jsf-使用primefaces对未处理的输入进行验证失败,java,jsf,jsf-2,primefaces,Java,Jsf,Jsf 2,Primefaces,我使用的是primefaces,在提交表单时,未经处理的输入验证失败:- <h:form id="result"> <p:outputPanel> <m:inputProperty property="#{prop}"></m:inputProperty> </p:outputPanel> <p:inputText value="#{helper.subFormName}" required="true" styleClass="

我使用的是primefaces,在提交表单时,未经处理的输入验证失败:-

<h:form id="result">
<p:outputPanel>
<m:inputProperty property="#{prop}"></m:inputProperty>
</p:outputPanel>
<p:inputText value="#{helper.subFormName}" required="true" styleClass="noprocess"
requiredMessage="#{tags.requiredMessage}" />
<p:commandButton value="#{msg.register}" action="#{registerBean.register}"
process="@(form:not(.noprocess))"></p:commandButton>
</h:form>

表单未提交,因为类noprocess的必需输入为空

这有什么问题?是过程表达式吗?还是什么?

在“form”和“:not”元素之间添加空格

@(form :not(.noprocess)) 
我试试看。它很好用。如果单击提交,则仅验证input2和input3

<?xml version="1.0" encoding="UTF-8"?>
<!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:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>Primefaces Selectors</title>
</h:head>
<h:body>
    <h:form>
        <p:messages autoUpdate="true" />
        <h:panelGrid columns="2">
            <p:outputLabel value="Input 1:" for="input1"/>
            <p:inputText id="input1" value="" required="true" styleClass="noprocess"/>

            <p:outputLabel value="Input 2:" for="input2"/>
            <p:inputText id="input2" value="" required="true"/>

            <p:outputLabel value="Input 3:" for="input3"/>
            <p:inputText id="input3" value="" required="true"/>
        </h:panelGrid>
        <p:commandButton value="Submit" process="@(form :not(.noprocess))" />
    </h:form>
</h:body>
</html>

素数面选择器

它仍在使用类noprocessbtw提交输入,它仍在提交我的输入,因此我将其设置为required=“false”以通过该问题=/