0

我在“更新”属性中设置正确的 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,但不明白...

4

1 回答 1

1

嗯..我想我明白了:

:processList:processes它一起工作......

于 2012-08-26T23:03:08.250 回答