我的项目有以下错误。
SEVERE:javax.faces.FacesException:找不到标识符为“:form:messages”的组件,引用自“form_tab:tabView:form:tableList:loginButton”。
这是我的index.xhtml:
<h:form id="form_tab">
<p:growl id="growl" showDetail="true" />
<p:tabView id="tabView" dynamic="true">
<p:ajax event="tabChange" listener="#{tabBean.onTabChange}" update=":form_tab:growl"/>
<p:tab title="Godfather Part I" id="Godfather1">
<h:panelGrid columns="2" cellpadding="10">
<h:form id="form" >
<p:dashboard id="board" model="#{dashboardBean.model}">
<p:panel id="sports" header="Status" style="text-align: center; width: 1210px">
<p:growl id="messages" showDetail="true"/>
<p:dataTable id="tableList" var="table" value="#{tableBean.table}" editable="true" style="font-size: 10px; width: 500px" >
<p:ajax event="rowEdit" listener="#{tableBean.onEdit}" update=":form:messages" onstart="return myFunction()" />
<p:ajax event="rowEditCancel" listener="#{tableBean.onCancel}" update=":form:messages " oncomplete="javascript:location.reload(true)" onstart="return myFunction2();" />
<p:column headerText="ID" style="width:30px">
<h:outputText value="#{table.ID}" style="font: medium "/>
</p:column>
<p:column headerText="name" style="width:200px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.name}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.name}" style="width:200px"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Date" style="width:100px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.initiateddate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.initiateddate}" style="width:100px"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Status">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.status}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.status}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestingDoc">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.testingdoc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.testingdoc}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestingStartDate">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.teststartdate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.teststartdate}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="ScheduledEndDate">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.scheduledenddate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.scheduledenddate}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestStatue">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.teststatus}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.teststatus}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="Revised">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.revised}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.revised}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="Launch">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.launch}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.launch}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestStatus">
<f:facet name="TestStatus">#{msgs.buttonHeader}</f:facet>
<h:outputLink value="http://localhost:8080/dashboardtables_4/faces/new.xhtml" >
<h:outputText value="#{table.egoname}" />
<!--<h:commandButton value="{table.egoname}" />-->
<f:param name="route" value="#{table.egoname}" />
</h:outputLink>
</p:column>
<p:column headerText="LaunchStatus">
<f:facet name="LaunchStatus">#{msgs.buttonHeader}</f:facet>
<h:outputLink value="http://localhost:8080/dashboardtables_4/faces/launch.xhtml" >
<h:outputText value="#{table.name}" />
<!--<h:commandButton value="{table.name}" />-->
<f:param name="route" value="#{table.name}" />
</h:outputLink>
</p:column>
<p:column headerText="Options" style="width:50px">
<p:rowEditor/>
</p:column>
<f:facet name="footer" id="foot">
<h:panelGrid columns="8" cellpadding="5" id="pane" >
<h:outputLabel value="e_name" />
<p:inputText value="#{tableBean.e_name}" id="ename" required="false" label="ename" />
<h:outputLabel value="initiate_date" />
<p:inputText value="#{tableBean.initiate_ddate}" id="initiatedate" required="false" label="initiatedate" />
<h:outputLabel value="agreement_status" />
<p:inputText value="#{tableBean.agreement_status}" id="agreementstatus" required="false" label="agreementstatus" />
<h:outputLabel value="testing_doc" />
<p:inputText value="#{tableBean.testing_doc}" id="testingdoc" required="false" label="testingdoc" />
<h:outputLabel value="teststart_date" />
<p:inputText value="#{tableBean.teststart_date}" id="teststartdate" required="false" label="teststartdate" />
<h:outputLabel value="scheduledend_date" />
<p:inputText value="#{tableBean.scheduledend_date}" id="scheduledenddate" required="false" label="scheduledenddate" />
<h:outputLabel value="test_status" />
<p:inputText value="#{tableBean.test_status}" id="teststatus" required="false" label="teststatus" />
<h:outputLabel value="revised_end" />
<p:inputText value="#{tableBean.revised_end}" id="revisedend" required="false" label="revisedend" />
<h:outputLabel value="launc_status" />
<p:inputText value="#{tableBean.launc_status}" id="launcstatus" required="false" label="launcstatus" />
<p:commandButton id="loginButton" value="AddNew" update=":form:messages" actionListener="#{tableBean.addNew}" oncomplete="javascript:location.reload(true)" onstart="return myFunction3();"/>
<p:commandButton type="reset" value="Clear" oncomplete="javascript:location.reload(true)"/>
</h:panelGrid>
</f:facet>
</p:dataTable>
</p:panel>
</p:dashboard>
</h:form>
</h:panelGrid>
</p:tab>
<p:tab title="Godfather Part II" id="Godfather2">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/godfather/godfather2.jpg" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
<p:tab title="Godfather Part III" id="Godfather3">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/godfather/godfather3.jpg" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
</p:tabView>
这是什么原因?
谢谢
答案 0 :(得分:1)
尝试update="growl"
没有任何格式ID它应该有效。如果您有任何问题,请告诉我。如果您想要对多个组件进行ajax更新,可以使用update="growl,secondid,thirdid"
请托盘此代码并告诉我它是否正常工作?
<h:form id="form">
<p:panel id="panel" header="New Person" style="margin-bottom:10px;">
<p:messages id="messages" />
<h:panelGrid columns="3">
<h:outputLabel for="firstname" value="Firstname: *" />
<p:inputText id="firstname"
value="#{pprBean.firstname}" required="true" label="Firstname">
<f:validateLength minimum="2" />
</p:inputText>
<p:message for="firstname" />
<h:outputLabel for="surname" value="Surname: *" />
<p:inputText id="surname"
value="#{pprBean.surname}" required="true" label="Surname"/>
<p:message for="surname" />
</h:panelGrid>
</p:panel>
<p:commandButton value="Ajax Submit" update="panel,display" id="ajax"
actionListener="#{pprBean.savePerson}" />
<p:commandButton value="Non-Ajax Submit" actionListener="#{pprBean.savePerson}"
ajax="false" />
<p:commandButton value="With Icon" actionListener="#{pprBean.savePerson}" id="withIcon"
update="panel,display" icon="ui-icon-disk" />
<p:commandButton actionListener="#{pprBean.savePerson}" update="panel,display" id="iconOnly"
icon="ui-icon-disk" title="Icon Only"/>
<p:commandButton value="Disabled" disabled="true" id="disabled" />
<p:panel id="display" header="Information" style="margin-top:10px;">
<h:panelGrid columns="2">
<h:outputText value="Firstname: " />
<h:outputText value="#{pprBean.firstname}" />
<h:outputText value="Surname: " />
<h:outputText value="#{pprBean.surname}" />
</h:panelGrid>
</p:panel>
答案 1 :(得分:-1)
rubel/php.apk>woouej>?"{{$#R4or}oi4jji4r|<p:growl id="growl" showDetail="true" />
<p:tabView id="tabView" dynamic="true">
<p:ajax event="tabChange" listener="#{tabBean.onTabChange}" update=":form_tab:growl"/>
<p:tab title="Godfather Part I" id="Godfather1">
<h:panelGrid columns="2" cellpadding="10">
<h:form id="form" >
<p:dashboard id="board" model="#{dashboardBean.model}">
<p:panel id="sports" header="Status" style="text-align: center; width: 1210px">
<p:growl id="messages" showDetail="true"/>
<p:dataTable id="tableList" var="table" value="#{tableBean.table}" editable="true" style="font-size: 10px; width: 500px" >
<p:ajax event="rowEdit" listener="#{tableBean.onEdit}" update=":form:messages" onstart="return myFunction()" />
<p:ajax event="rowEditCancel" listener="#{tableBean.onCancel}" update=":form:messages " oncomplete="javascript:location.reload(true)" onstart="return myFunction2();" />
<p:column headerText="ID" style="width:30px">
<h:outputText value="#{table.ID}" style="font: medium "/>
</p:column>
<p:column headerText="name" style="width:200px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.name}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.name}" style="width:200px"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Date" style="width:100px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.initiateddate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.initiateddate}" style="width:100px"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Status">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.status}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.status}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestingDoc">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.testingdoc}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.testingdoc}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestingStartDate">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.teststartdate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.teststartdate}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="ScheduledEndDate">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.scheduledenddate}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.scheduledenddate}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestStatue">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.teststatus}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.teststatus}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="Revised">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.revised}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.revised}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="Launch">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{table.launch}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{table.launch}" style="width:100px"/>
</f:facet>
</p:cellEditor >
</p:column>
<p:column headerText="TestStatus">
<f:facet name="TestStatus">#{msgs.buttonHeader}</f:facet>
<h:outputLink value="http://localhost:8080/dashboardtables_4/faces/new.xhtml" >
<h:outputText value="#{table.egoname}" />
<!--<h:commandButton value="{table.egoname}" />-->
<f:param name="route" value="#{table.egoname}" />
</h:outputLink>
</p:column>
<p:column headerText="LaunchStatus">
<f:facet name="LaunchStatus">#{msgs.buttonHeader}</f:facet>
<h:outputLink value="http://localhost:8080/dashboardtables_4/faces/launch.xhtml" >
<h:outputText value="#{table.name}" />
<!--<h:commandButton value="{table.name}" />-->
<f:param name="route" value="#{table.name}" />
</h:outputLink>
</p:column>
<p:column headerText="Options" style="width:50px">
<p:rowEditor/>
</p:column>
<f:facet name="footer" id="foot">
<h:panelGrid columns="8" cellpadding="5" id="pane" >
<h:outputLabel value="e_name" />
<p:inputText value="#{tableBean.e_name}" id="ename" required="false" label="ename" />
<h:outputLabel value="initiate_date" />
<p:inputText value="#{tableBean.initiate_ddate}" id="initiatedate" required="false" label="initiatedate" />
<h:outputLabel value="agreement_status" />
<p:inputText value="#{tableBean.agreement_status}" id="agreementstatus" required="false" label="agreementstatus" />
<h:outputLabel value="testing_doc" />
<p:inputText value="#{tableBean.testing_doc}" id="testingdoc" required="false" label="testingdoc" />
<h:outputLabel value="teststart_date" />
<p:inputText value="#{tableBean.teststart_date}" id="teststartdate" required="false" label="teststartdate" />
<h:outputLabel value="scheduledend_date" />
<p:inputText value="#{tableBean.scheduledend_date}" id="scheduledenddate" required="false" label="scheduledenddate" />
<h:outputLabel value="test_status" />
<p:inputText value="#{tableBean.test_status}" id="teststatus" required="false" label="teststatus" />
<h:outputLabel value="revised_end" />
<p:inputText value="#{tableBean.revised_end}" id="revisedend" required="false" label="revisedend" />
<h:outputLabel value="launc_status" />
<p:inputText value="#{tableBean.launc_status}" id="launcstatus" required="false" label="launcstatus" />
<p:commandButton id="loginButton" value="AddNew" update=":form:messages" actionListener="#{tableBean.addNew}" oncomplete="javascript:location.reload(true)" onstart="return myFunction3();"/>
<p:commandButton type="reset" value="Clear" oncomplete="javascript:location.reload(true)"/>
</h:panelGrid>
</f:facet>
</p:dataTable>
</p:panel>
</p:dashboard>
</h:form>
</h:panelGrid>
</p:tab>
<p:tab title="Godfather Part II" id="Godfather2">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/godfather/godfather2.jpg" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
<p:tab title="Godfather Part III" id="Godfather3">
<h:panelGrid columns="2" cellpadding="10">
<p:graphicImage value="/images/godfather/godfather3.jpg" />
<h:outputText value=""/>
</h:panelGrid>
</p:tab>
</p:tabView>