h:commandButton和ajax错误

h:commandButton和ajax错误,ajax,jsf,jsf-2,commandbutton,Ajax,Jsf,Jsf 2,Commandbutton,我的网页上有: <h:form id="qw"> <h:panelGrid columns="3" > <h:outputLabel for="username" value="Login:"/> <h:inputText id="username" value="#{userManager.userName}" required="true"> <f:ajax

我的网页上有:

<h:form id="qw">
    <h:panelGrid columns="3" >
           <h:outputLabel for="username" value="Login:"/>
           <h:inputText id="username" value="#{userManager.userName}" required="true">
              <f:ajax event="blur" render="usernameMessage"/>
           </h:inputText>
           <h:message id="usernameMessage" for="username" />

           <h:outputLabel for="password" value="#{msg.password}"/>
           <h:inputSecret id="password" value="#{userManager.password}" required="true">
              <f:ajax event="blur" render="passwordMessage" />
            </h:inputSecret>
            <h:message id="passwordMessage" for="password" />

           <h:commandButton value="#{msg.login}" action="#{userManager.login}">
              <f:ajax execute="@form" render=" @form qw usernameMessage passwordMessage messages"/>
           </h:commandButton> 
       </h:panelGrid>
   </h:form>

   <h:messages id="messages" globalOnly="true"/>

这是什么意思?怎么了?我不能在Ajax中使用h:commandButton?

使用JSF2时,xhtml看起来很好。打开表单,使用输入字段、消息和ajaxified commandButton。您可以跳过重新命名
qw
usernameMessage
passwordMessage
——它们已经是@form的一部分


h:messages
在表单之外,不应该受到任何伤害。可能这是myFaces实现中的一个特殊问题,或者您只是以某种方式丢失了一个连接—从JSF的角度来看,您应该是安全的。

使用JSF2时,xhtml看起来很好。打开表单,使用输入字段、消息和ajaxified commandButton。您可以跳过重新命名
qw
usernameMessage
passwordMessage
——它们已经是@form的一部分


h:messages
在表单之外,不应该受到任何伤害。可能这是myFaces实现中的一个特殊问题,或者您只是以某种方式丢失了一个连接—从JSF的角度来看,您应该是安全的。

使用JSF2时,xhtml看起来很好。打开表单,使用输入字段、消息和ajaxified commandButton。您可以跳过重新命名
qw
usernameMessage
passwordMessage
——它们已经是@form的一部分


h:messages
在表单之外,不应该受到任何伤害。可能这是myFaces实现中的一个特殊问题,或者您只是以某种方式丢失了一个连接—从JSF的角度来看,您应该是安全的。

使用JSF2时,xhtml看起来很好。打开表单,使用输入字段、消息和ajaxified commandButton。您可以跳过重新命名
qw
usernameMessage
passwordMessage
——它们已经是@form的一部分


h:messages
在表单之外,不应该受到任何伤害。可能这是myFaces实现的一个特殊问题,或者您只是以某种方式丢失了一个连接-从JSF的角度来看,您应该是安全的。

在阅读了L-Ray的回答后,我意识到
h:messages
在表单之外,所以我必须在name
messages
之前添加
。应该是:

    <h:commandButton value="#{msg.login}" action="#{userManager.login}">
        <f:ajax execute="@form" render=" @form :messages"/>
    </h:commandButton> 

有关它的更多信息,请阅读:

在阅读了L-Ray的答案后,我意识到
h:messages
在表单之外,因此我必须在name
messages
之前添加
。应该是:

    <h:commandButton value="#{msg.login}" action="#{userManager.login}">
        <f:ajax execute="@form" render=" @form :messages"/>
    </h:commandButton> 

有关它的更多信息,请阅读:

在阅读了L-Ray的答案后,我意识到
h:messages
在表单之外,因此我必须在name
messages
之前添加
。应该是:

    <h:commandButton value="#{msg.login}" action="#{userManager.login}">
        <f:ajax execute="@form" render=" @form :messages"/>
    </h:commandButton> 

有关它的更多信息,请阅读:

在阅读了L-Ray的答案后,我意识到
h:messages
在表单之外,因此我必须在name
messages
之前添加
。应该是:

    <h:commandButton value="#{msg.login}" action="#{userManager.login}">
        <f:ajax execute="@form" render=" @form :messages"/>
    </h:commandButton> 

有关它的更多信息,请阅读:

如果L-Ray的答案对你有效,你为什么不接受?如果L-Ray的答案对你有效,你为什么不接受?如果L-Ray的答案对你有效,你为什么不接受?如果L-Ray的答案对你有效,你为什么不接受?