Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.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
Javascript 当openFaces组件中的validationError=true时,具体的验证错误是什么_Javascript_Html_Openfaces_Validationerror_Datechooser - Fatal编程技术网

Javascript 当openFaces组件中的validationError=true时,具体的验证错误是什么

Javascript 当openFaces组件中的validationError=true时,具体的验证错误是什么,javascript,html,openfaces,validationerror,datechooser,Javascript,Html,Openfaces,Validationerror,Datechooser,我使用openFaces的dateChooser并设置了一个模式。 如果我在其中输入了错误的值(如:33/33/33),并尝试提交validationError,则由于格式错误而将其设置为true,但我不知道如何获取导致验证错误的特定错误消息或组件 以下是我代码的一部分: <o:dateChooser id="DateColBtnGeneralView" pattern="#{configurationController.defaultDateFormat}"

我使用openFaces的dateChooser并设置了一个模式。 如果我在其中输入了错误的值(如:33/33/33),并尝试提交validationError,则由于格式错误而将其设置为true,但我不知道如何获取导致验证错误的特定错误消息或组件

以下是我代码的一部分:

<o:dateChooser 
    id="DateColBtnGeneralView" 
    pattern="#{configurationController.defaultDateFormat}"
    value="#{homeController.firstDate}">
    <f:convertDateTime pattern="#{configurationController.defaultDateFormat}"/>   
</o:dateChooser>

<o:commandButton
    action="#{homeController.submitDates}"
    onsuccess="contractClientDialogValidation(event)
    value="Submit" />

function contractClientDialogValidation (event) {
    if (event.validationError) {
        alert("I want to show you the right error message according to the wrong value and component");
    }
}


验证错误主要与JSF生命周期中的UpdateModelValues和InvokeApplication阶段有关

在元素内部,可以选择使用标记

ajax请求/响应生命周期完成后,呈现标记

我试图添加