• BrianFarrell
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

Hi ,

I have a VisualForce page that allows you to enter text in fields and then display them in a formatted PDF page by clicking a preview button. This is done by using a second VisualForce page to display the rendered PDF. I want the rendered PDF page to appear in a separate windows page.

First VF Page - Enter PDF Text

                <apex:commandButton id="previewButton" action="{!previewPDF}" value="Preview"/>

the action !previewPDF is then called in an apex class

Apex Class

The class contains processing to calculate and format fields on the final rendered page and finally
creates a new page reference

  public pagereference previewPDF () {
        // Direct to the PDF page
        PageReference pageRef = new PageReference('/apex/vfNCDLetterBF?id=' + Policy__c.Id);      
        return pageRef;
  }

Second VF Page - Render PDF Text

This VF page should then render the text as a PDF in a separate window but it appears in the original window which forces the user to use the back button to return to the first VF Page.

I have tried adding the onClick.Window javascript to the first VF page but this does not work.
I have found similiar answers to this question but they dont work with my pages and classes
I have already tried this solution which did not work for me as a need to call the apex class before I

execute the onclick command.

 

http://boards.developerforce.com/t5/Visualforce-Development/opening-a-new-window-from-apex-code/m-p/241731/highlight/true#M31916

 

Any insights or help would be appreciated

Many Thanks
Brian

Hi All,

 

I'm new to Salesforce so forgive me if this question has been asked before.

 

We have a Salesforce instance with custom address fields. I want to add functionality in a custom button

which takes various address components e.g. post code, house no etc and sends them to a third party tool

that will use these details to return area specific information back to a custom Salesforce field. We have an API to access the methods for this 3rd party site but I want to know what is the best way to construct the API call via the button. Do we use the Javascript feature on the Custom Button settings or can we use the AJAX Remote proxy functionality

 

Many Thanks

Brian   

Hi ,

I have a VisualForce page that allows you to enter text in fields and then display them in a formatted PDF page by clicking a preview button. This is done by using a second VisualForce page to display the rendered PDF. I want the rendered PDF page to appear in a separate windows page.

First VF Page - Enter PDF Text

                <apex:commandButton id="previewButton" action="{!previewPDF}" value="Preview"/>

the action !previewPDF is then called in an apex class

Apex Class

The class contains processing to calculate and format fields on the final rendered page and finally
creates a new page reference

  public pagereference previewPDF () {
        // Direct to the PDF page
        PageReference pageRef = new PageReference('/apex/vfNCDLetterBF?id=' + Policy__c.Id);      
        return pageRef;
  }

Second VF Page - Render PDF Text

This VF page should then render the text as a PDF in a separate window but it appears in the original window which forces the user to use the back button to return to the first VF Page.

I have tried adding the onClick.Window javascript to the first VF page but this does not work.
I have found similiar answers to this question but they dont work with my pages and classes
I have already tried this solution which did not work for me as a need to call the apex class before I

execute the onclick command.

 

http://boards.developerforce.com/t5/Visualforce-Development/opening-a-new-window-from-apex-code/m-p/241731/highlight/true#M31916

 

Any insights or help would be appreciated

Many Thanks
Brian