2013-08-01 98 views
0

我有一段代码如下错误与咆哮

<p:growl id="noti-growl"/> 
     <h:form id="login-form"> 
      <p:panel> 
       <h:commandButton value="Đăng nhập" class="button-login" action="index"> 
        <f:ajax execute="@form" render="noti-growl"/> 
       </h:commandButton> 
      </p:panel> 
     </h:form> 

而且我收到了一条错误如下

<f:ajax> contains an unknown id 'noti-growl' - cannot locate it in the context of the component j_idt9 

请为我解释一下吗?感谢您的帮助

+0

可能重复[如何引用JSF ajax中的组件?无法在视图中查找标识符为“foo”的组件)(http://stackoverflow.com/questions/8634156/how-to-reference-components-in-jsf-ajax-cannot-find-component-with-identifier) – Andy

回答

2

要么把咆哮在自己的形式如下

<h:form id="login-form"> 
    <p:growl id="noti-growl"/> 
</h:form> 

或者你应该把咆哮不同形式的全名更新:的

<h:form id = "growlForm">  
    <p:growl id="noti-growl"/> 
</form> 

<h:form id="login-form"> 
     <p:panel> 
      <h:commandButton value="Đăng nhập" class="button-login" action="index" update = ":growlForm:noti_growl"> 

     </p:panel> 
    </h:form> 
+0

感谢你这么多 – ThiepLV

+0

不客气:) –