Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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
Jsf 回发时不计算样式属性中的条件_Jsf_Bean Validation - Fatal编程技术网

Jsf 回发时不计算样式属性中的条件

Jsf 回发时不计算样式属性中的条件,jsf,bean-validation,Jsf,Bean Validation,我正在努力实现以下要求: 在验证错误的工具提示中显示错误消息 突出显示验证失败的组件 我实现了如下内容 <table> <tr> <td> <a4j:outputPanel id="studentPanel"> <h:inputText value="#{studentBean.studentNumber}" id="studentNumber" style="#{not co

我正在努力实现以下要求:

  • 在验证错误的工具提示中显示错误消息
  • 突出显示验证失败的组件
  • 我实现了如下内容

    <table>
       <tr>
          <td>
              <a4j:outputPanel id="studentPanel"> 
                 <h:inputText value="#{studentBean.studentNumber}" id="studentNumber" style="#{not component.valid ? 'border-color:red;' : 'border-color:none;'}" required="true" requiredMessage="#{msg.studentNoValidationMsg}">
                 </h:inputText>
                 <rich:tooltip for="studentNumber"> 
                     <rich:message for="studentNumber"></rich:message>
                 </rich:tooltip>
              </a4j:outputPanel>
          </td>
        </tr>
    </table>
    
    
    

    如果验证失败,将显示工具提示和验证消息。但是,该组件不会以红色突出显示。我是否遗漏了任何步骤?

    您是自己管理组件渲染还是提交完整的表单?我正在提交完整的表单。您是使用
    form
    还是
    h:form