我在
的'update'属性中设置正确的ID时遇到问题 <p:outputPanel>
<h:panelGrid columns="2">
<h:outputText value="#{msg.uploadNewProcessLabel}" />
<h:form id="fileupload">
<p:fileUpload id="fileuploadButton" auto="true"
customUI="true" fileUploadListener="#{processImporter.processFile}"
update=":processes" label="Upload" />
</h:form>
</h:panelGrid>
</p:outputPanel>
<p:outputPanel>
<h:form id="processList">
<p:dataTable id="processes" var="process"
value="#{processDefinitionList}"
paginator="true" rows="10" paginatorAlwaysVisible="false">
我收到以下错误消息:
javax.faces.FacesException: Cannot find component with identifier ":processes" referenced from "fileupload:fileuploadButton".
at org.primefaces.util.ComponentUtils.findClientIds(ComponentUtils.java:251)
at org.primefaces.component.fileupload.FileUploadRenderer.encodeScript(FileUploadRenderer.java:113)
at org.primefaces.component.fileupload.FileUploadRenderer.encodeEnd(FileUploadRenderer.java:90)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
在另一个已回答的问题上,我得到了提示:在组件id前面,这应该导致从“上层”扫描。
这究竟是什么意思?我读了UIComponents.findComponent JavaDoc,但是没有得到这个想法......
答案 0 :(得分:1)
:processList:processes
它有效......