0

I have problems setting the correct id in the 'update' attribute of

        <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">

I get the following error message:

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)

On an other answered question I got the hint with : in front of the components id, which should lead to a scan from the 'upper level'.

What exactly does this mean? I read the UIComponents.findComponent JavaDoc, but don't get the idea...

messivanio
  • 2,263
  • 18
  • 24
Joysn
  • 987
  • 1
  • 16
  • 30

1 Answers1

1

hm.. i think i got it:

with :processList:processes it works...

Joysn
  • 987
  • 1
  • 16
  • 30
  • for reference, starting an id with : means it's a root id, in other words an element not inside a container. processes lies inside processList form, which is a container, thus processList:processes. – Rasmus Franke Aug 27 '12 at 19:59
  • This syntax is specified as *"search expression"* in `UIComponent#findComponent()` javadoc: http://docs.oracle.com/javaee/6/api/javax/faces/component/UIComponent.html#findComponent%28java.lang.String%29 – BalusC Aug 27 '12 at 20:02
  • thanks for the explaining words :) – Joysn Aug 28 '12 at 09:21