You need to sign in to do that
Don't have an account?
Karthick Raja
Redirect to Home Page once the word doc is downloaded
Hi folks,
Can anyone tell me how to redirect the homepage from download page automatically ?
I have a visualforce page which downloads the content of the page.Once the document is downloaded then it will automatically redirect to home page.
For that How can I implement.
My vfp
Controller:
I have tried action attribute on page tag but nothing happne.
Please let me know is there any way to automatically redirect after the document is downloaded
Thanks in advance
Karthick
Can anyone tell me how to redirect the homepage from download page automatically ?
I have a visualforce page which downloads the content of the page.Once the document is downloaded then it will automatically redirect to home page.
For that How can I implement.
My vfp
<apex:page standardController="Account" extensions="AccountDownload" contentType="application/msWord/#Test-{!NOW()}.doc" recordSetVar="accounts" sidebar="false" cache="true"> <apex:form > <apex:pageBlock title="Archiver For Account"> <apex:pageBlockSection > <apex:pageBlockTable value="{!accounts}" var="ac" > <apex:column headerValue="AccountName"> <apex:outputText >{!ac.Name}</apex:outputText> </apex:column> <apex:column headerValue="Account Number"> <apex:outputText >{!ac.AccountNumber}</apex:outputText> </apex:column> <apex:column headerValue="AccountType"> <apex:outputText >{!ac.Type}</apex:outputText> </apex:column> <apex:column headerValue="Phone Number"> <apex:outputText >{!ac.Phone}</apex:outputText> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> <apex:outputText value="hi dude,"/> </apex:form> </apex:page>
Controller:
public class AccountDownload { public boolean ren{get;set;} public AccountDownload(ApexPages.StandardSetController controller) { ren=false; rtnToHome(); } public PageReference Download(){ ren=true; return null; } public PageReference rtnToHome(){ PageReference demoPage = new pagereference('/apex/AccountasTextfile'); demoPage.setRedirect(true); return demoPage; } }
I have tried action attribute on page tag but nothing happne.
Please let me know is there any way to automatically redirect after the document is downloaded
Thanks in advance
Karthick
i have on doubt..
what is the purpose of public boolean ren{get;set;}.
this is normally property of {! }.
but this was not defined in the VF.
and download() and rtnHome() methods were also not defined in VF but you have used..
how it is possible?
please kindly explain me..
Thanking you in advance..
My first vfp code is:
2nd page is:
Extention for both pages as follows:
My question is: when I click download button on first page then the content of the second page will download .
Once download is complete then automatically redirect to my first page.
For that What I have to modify.
Please help on this