I code page with JSF, I want to update the growl when I click the commandButton, but there is a exception:
Code: Select all
ERROR [io.undertow.request] (default task-5) UT005023: Exception handling request to /accWeb/faces/index.xhtml: javax.servlet.ServletException: Cannot find component with expression "growl" referenced from "j_idt11:form:j_idt19:0:j_idt24".
Code: Select all
<h:form id="form">
<p:growl id="growl"/>
<p:commandButton icon="ui-icon-plusthick"
onclick="PF('addDeviceDlg').show();"/>
<p:commandButton icon="ui-icon-calendar"
action="#{deviceListView.showSimpleTable}"/>
<p:commandButton icon="ui-icon-calculator"
action="#{deviceListView.showDetailTable}"/>
<!-- the simple data table -->
<p:messages for="deviceTable" />
<p:dataTable var="device"
value="#{deviceListView.devices}"
widgetVar="deviceFilter"
rendered="#{!deviceListView.switchTable}">
<f:facet name="header">
<p:outputPanel style="height:30px">
<p:inputText id="globalFilter"
onkeyup="PF('deviceFilter').filter()"
style="width:150px;float:right" />
<h:outputText value="#{locale.dev_search}"
style="float:right" />
</p:outputPanel>
</f:facet>
<p:column headerText="#{locale.dev_devName}"
sortBy="#{device.deviceName}"
filterBy="#{device.deviceName}"
filterMatchMode="contains"
filterStyle="display:none; visibility:hidden;">
<p:outputLabel value="#{device.deviceName}"/>
<p:commandButton icon="ui-icon-closethick"
title="#{device.uid}"
action="index"
actionListener="#{deviceListView.deleteDevice}"
style="float:right"
update="growl"/>
</p:column>
<p:column headerText="#{locale.dev_online}">
<p:outputLabel value="#{device.online}"/>
</p:column>
<p:column headerText="#{locale.dev_alarm}">
<p:outputLabel value="#{device.alarmEnable}"/>
</p:column>
<p:column headerText="#{locale.dev_guard}">
<p:outputLabel value="#{device.guardEnable}"/>
</p:column>
</p:dataTable>
<!-- the detail data table -->
<p:dataTable var="device"
value="#{deviceListView.devices}"
widgetVar="deviceTable"
rows="1"
paginator="true"
rendered="#{deviceListView.switchTable}">
<p:column>
<p:panelGrid columns="3">
<p:outputLabel value="#{locale.dev_sn}"/>
<p:outputLabel value="#{device.uid}"/>
<p:inputText value="#{device.uid}" readonly="true"/>
<p:outputLabel value="#{locale.dev_devName}"/>
<p:outputLabel value="#{device.deviceName}"/>
<p:inputText value="#{device.deviceName}"/>
<p:outputLabel value="#{locale.dev_online}"/>
<p:outputLabel value="#{device.online}"/>
<p:outputLabel/>
<p:outputLabel value="#{locale.dev_alarm}"/>
<p:outputLabel value="#{device.alarmEnable}"/>
<p:inputText />
<p:outputLabel value="#{locale.dev_guard}"/>
<p:outputLabel value="#{device.guardEnable}"/>
<p:inputText />
</p:panelGrid>
</p:column>
</p:dataTable>
<p:panel style="text-align:center;border:0;" >
<p:commandButton value="#{locale.dev_submit}"
rendered="#{deviceListView.switchTable}"
action="#{deviceListView.editDevice}"
style="float:center"/>
</p:panel>
<!-- add device dialog -->
<p:dialog position="center"
header="add device"
id="addDevice"
widgetVar="addDeviceDlg"
style="text-align :center;">
<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel value="uid"/>
<p:inputMask value="#{deviceListView.uid}"
mask="****************"
tabindex="1"/>
<p:outputLabel value="devname"/>
<p:inputText value="#{deviceListView.devName}" tabindex="2"/>
<p:outputLabel value="devpassword"/>
<p:password value="#{deviceListView.devPwd}" tabindex="3"/>
</h:panelGrid>
<p:commandButton value="add device"
action="#{deviceListView.addDevice}"
onclick="PF('addDeviceDlg').hide()"
update="growl"
tabindex="4"/>
</p:dialog>
</h:form>
how can I fix the exception.
any ideas? Thank you!