P:fileUpload + PrimeFaces

Galera,

Estou querendo colocar mais de um p:fileUpload na mesma pagina e não estou conseguindo.
O erro é o seguinte, sempre o abaixo que esta funcionado. Eu preciso dos 2 p:fileUpload.
Estou usando o PrimeFaces 3.0.M3

Abaixo o meu codigo XHTML

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <h:head>
            <title>Inovar - Coletor</title>
            <style type="text/css">
                body {
                    margin:0;
                    padding:0;

                    text-align:center; /* hack para o IE */	
                }
                #tudo {
                    width: 760px;
                    margin:0 auto;			
                    text-align:left; /* "remédio" para o hack do IE */	
                }
                #conteudo {
                    padding: 5px;

                }
            </style>
        </h:head>
        <h:body>
            <div id="tudo">

                <div id="conteudo">

                    <h:form >
                        <p:growl id="messages" showDetail="true"/>
                        <p:panel header="Coletor" footer="C&amp;S Sistemas - V 1.0" id="panel">  
                            <h:panelGrid columns="4" >
                                <h:outputLabel value="Arquivo de Entrada" style="float: right"/>
                                <p:spacer  width="20" />
                                <p:fileUpload id="fileUm" fileUploadListener="#{coletorControle.carregarArquivoDeEntrada}" sizeLimit="204800" auto="true"  label="Arquivo De Entrada"/>
                                <p:spacer height="10" />
                                 <h:outputLabel value="Arquivo de Coletor" style="float: right"/>
                                <p:spacer  width="20" />
                                <p:fileUpload id="fileDois" fileUploadListener="#{coletorControle.carregarArquivoDeColetor}" sizeLimit="204800" auto="true" label="Arquivo Coletor"/>
                                <p:spacer height="10" />
                                <h:outputLabel value="Área(IPC)" style="float: right"/>
                                <p:spacer  width="20" />
                                <h:inputText style="width:295px" />
                                <p:spacer height="10" />
                                 <h:outputLabel value="Área(ICF)" style="float: right"/>
                                <p:spacer  width="20" />
                                <h:inputText style="width:295px" />
                                <p:spacer height="10" />
                            </h:panelGrid>
                        </p:panel>  
                    </h:form>

                </div></div>

        </h:body>
    </f:view>
</html>

falto o erro oq acontece?

WTF?! :shock:

Vc tá querendo dizer que o primeiro funciona e o segundo p:up… não?

Galera,

Seguinte, sempre é o segundo que funciona. Se eu mandar o primeiro carregar o arquivo ele nao carrega, se eu mandar o segundo carregar o arquivo ele carrega o arquivo e mostra a barra de status nos dois p:fileUpload, mesmo estando apontando para metodos diferentes.

Att

Quando eu fiz upload eu tive que colocar meu form como:

enctype="multipart/form-data"

Outra coisa, tenta colocar os uploads em forms diferentes como teste.

Ok
Vou testar.

Att

Galera,

Coloquei do jeito que a turma sugeriu.
Abaixo o meu código:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <f:view>
        <h:head>
            <title>Inovar - Coletor</title>
            <style type="text/css">
                body {
                    margin:0;
                    padding:0;

                    text-align:center; /* hack para o IE */	
                }
                #tudo {
                    width: 760px;
                    margin:0 auto;			
                    text-align:left; /* "remédio" para o hack do IE */	
                }
                #conteudo {
                    padding: 5px;

                }
            </style>
        </h:head>
        <h:body>
            <div id="tudo">

                <div id="conteudo">

                    <h:form prependId="false" enctype="multipart/form-data">
                        <p:growl id="messages" showDetail="true"/>
                        <p:panel header="Coletor" footer="C&amp;S Sistemas - V 1.0" id="panel">  
                            <h:panelGrid columns="1" >
                                <h:form id="fr1" enctype="multipart/form-data">
                                    <h:panelGrid columns="4" >
                                        <h:outputLabel value="Arquivo de Entrada" style="float: right"/>
                                        <p:spacer  width="18" />
                                        <p:fileUpload id="fileUm" fileUploadListener="#{coletorControle.carregarArquivoDeEntrada}" sizeLimit="204800000" auto="true"  label="Arquivo De Entrada" />
                                        <p:spacer height="10" />
                                    </h:panelGrid>
                                </h:form>

                                <h:form id="fr2" enctype="multipart/form-data" >
                                    <h:panelGrid columns="4" >
                                        <h:outputLabel value="Arquivo de Coletor" style="float: right" />
                                        <p:spacer  width="20" />
                                        <p:fileUpload id="fileDois" fileUploadListener="#{coletorControle.carregarArquivoDeColetor}" sizeLimit="204800000" auto="true" label="Arquivo Coletor" />
                                        <p:spacer height="10" />
                                        <h:outputLabel value="Área(IPC)" style="float: right"/>
                                        <p:spacer  width="20" />
                                        <h:inputText style="width:150px" />
                                        <p:spacer height="10" />
                                        <h:outputLabel value="Área(ICF)" style="float: right"/>
                                        <p:spacer  width="20" />
                                        <h:inputText style="width:150px" />
                                        <p:spacer height="10" />
                                    </h:panelGrid>
                                </h:form>
                            </h:panelGrid>
                        </p:panel>  
                    </h:form>

                </div></div>

        </h:body>
    </f:view>
</html>

So que agora esta com o seguinte problema: quando mando carregar o primeiro p:fileUpload ele mostra o status no primeiro e no segundo p:fileUpload, ja no segundo p:fileUpload mostra normal.

Mesmo problema. Aparentemente se retirar o prependId=“false” ele mostra os arquivos em ambos senão mostra somente no último.