0

I have a visualforce page that call a method that return the URL to download a contentdocument (chatter document), but when I make click the button doesn't rerender anything, deleteFile method only return null, this is my vfp:

<apex:page standardController="npe03__Recurring_Donation__c" extensions="ReporteCompromisosExportacionController" action="{!getFile}" tabStyle="Reporte_Compromisos__tab">  
    <apex:form id="form">
        <apex:actionFunction name="downloadf" action="{!downloadFile}" />
        <apex:actionFunction name="deletef" action="{!deleteFile}" reRender="form,errors,page,buttons,download"/>       
        <apex:pageMessages id="errors"/>
        <apex:pageBlock id="page">
            <apex:pageBlockSection columns="1" title="Descargar Archivo de Cobranza" collapsible="false" id="descargar">
                <apex:pageBlockSectionItem >
                    <apex:image url="{!$Resource.excelIcon}" width="30" height="30" rendered="{!download}"/>
                    <apex:outputText id="name" value="{!fileName}"/>                    
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom" id="buttons">
                <apex:CommandButton id="download" value="Descargar Archivo" action="{!downloadFile}" oncomplete="deletef();" rerender="form,errors,page,buttons,download" disabled="{!!download}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>
7
  • when does actionFunction downloadf triggers? Jan 19, 2017 at 22:11
  • Change it to <apex:CommandButton id="download" value="Descargar Archivo" action="{!downloadFile}" oncomplete="deletef(); return false;" rerender="form,errors,page,buttons,download" disabled="{!!download}"/>
    – Ashwani
    Jan 19, 2017 at 22:32
  • What is the return type of your downloadFile() ? void or PageReference?
    – highfive
    Jan 20, 2017 at 5:14
  • @Ashwani I added the return false and doesn't work. Jan 20, 2017 at 13:18
  • @highfive is a Pagereference but returns null Jan 20, 2017 at 13:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.