为什么在验证错误消息后没有提交表单?

时间:2011-04-18 15:09:45

标签: jsf ajax4jsf

我有一个表单来更新用户的信息,如果验证失败,它会显示错误信息,并在纠正错误输入后,表单没有提交为什么?没有错误消息,它提交得很好。

<h:form id="update" prependId="false">
    <h:outputText value="Name: " styleClass="titleBlue"/>
    <h:inputText id="contactName" value="#{serviceBean.contactName}" maxlength="50" size="15" style="width:200px" >
        <f:validateLength minimum="3" maximum="50"/>             
    </h:inputText>              
    <h:message for="contactName" style="color:red;font-size: 0.70em;"/>
    <h:outputText value="Title: " styleClass="titleBlue"/>
    <h:inputText id="contactTitle" value="#{serviceBean.contactTitle}" maxlength="50" size="15" style="width:200px">
        <f:validateLength minimum="3" maximum="50"/>
    </h:inputText>
    <h:message for="contactTitle" style="color:red;font-size: 0.70em;"/>
    <h:panelGroup style="display:block; text-align:center">
        <a4j:commandButton action="#{serviceBean.update}" styleClass="titleBold" value="Update"/>
    </h:panelGroup>
</h:form>

1 个答案:

答案 0 :(得分:0)

为什么在显示警告消息后表单无法提交: 如果值为null,我需要id设置默认值并提交表单。