fileDownload issue

UI Components for JSF
zkropotkine
Posts: 24
Joined: 10 Jul 2010, 17:42

16 Jul 2010, 18:47

Yeah, we were using ajax set to false, this was our original code:

Code: Select all

            <p:commandLink  id="desc-${solicitud.convenio.ssconvId}-${documento.ssarchId}" ajax="false" immediate="true">
                <p:graphicImage value="/resources/images/download.gif"  styleClass="img_sinborde"/>
                <p:fileDownload  id="downl-${solicitud.convenio.ssconvId}-${documento.ssarchId}" value="#{documento.contenido}" />
            </p:commandLink>
<p:commandLink id="desc-${solicitud.convenio.ssconvId}-${documento.ssarchId}" ajax="false" immediate="true">...

Thanks in advance :P
  • Glassfish 2.1.1
  • Mojara 2.0.3
  • PF 2.2M1
  • JSF 2.0
  • Firefox 3.6.10
  • Ubuntu 10
  • Netbeans 6.8

SRS
Posts: 10
Joined: 16 Apr 2010, 11:29

27 Jul 2010, 10:59

Have the same problem
If I use p:commandLink ajax="false":

Code: Select all

                       <p:column styleClass="column_center">
                            <f:facet name="header">
                                <h:outputText value='Report'/>
                            </f:facet>
                            <p:commandLink ajax="false">
                                <qp:imageButton type="#{imageType.getXLS_SMALL()}" title="#{res['image.title.xls']}"/>
                                <p:fileDownload value="#{fileBB.getFileDownload(item.settlementFileInfoId)}"/>
                            </p:commandLink>
                        </p:column>
                        <p:column styleClass="column_center">
                            <f:facet name="header">
                                <h:outputText value='Invoice'/>
                            </f:facet>
                            <p:commandLink ajax="false">
                                <qp:imageButton type="#{imageType.getXLS_SMALL()}" title="#{res['image.title.xls']}"/>
                                <p:fileDownload value="#{fileBB.getFileDownload(item.invoiceFileInfoId)}"/>
                            </p:commandLink>
                        </p:column>
Then when click on first link I receive first file. Then I click on the second link and receive the same file.
Because for second links method fileBB.getFileDownload calls twice - for first link and for second.

Using h:commandLink ajax="false" - solve the problem

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Jul 2010, 11:28

Hi SRS,

Please create a new post for your question and take a moment to read forum guideline;

http://primefaces.prime.com.tr/forum/vi ... f=3&t=1194

Especially 5 and 6.

Thanks.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests