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

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

4

1 回答 1

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>
于 2013-08-01T09:40:30.707 回答