• Pablo Mattioli
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,

I have created two visualforce pages. One with command button. When i click on button it will redirect to the second vf page. In first vf page controller am fetching the contact fields. Now i want to use those contact fields in second vf page controller. How to do this.. below is my vf pages and its controllers.

VF Page : 1
<apex:page standardController="Contact" extensions="TestController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
            <apex:commandButton value="Login" action="{!Login}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller : 1
public with sharing class TestController {
    Private Contact con;
    public YodleeController(ApexPages.StandardController controller) {
        String ConId = ApexPages.CurrentPage().getparameters().get('id');
        Contact con = [Select id, FirstName, LastName, PAN_ID__c from Contact where id=:ConId];
        system.debug('conId--'+con.id);
        system.debug('conPAN---'+con.PAN_ID__c);
    }
    public PageReference Login() {
        PageReference page = new PageReference('/apex/LinkAccess');
        page.setRedirect(true);
        return page;
    }  
}

VF Page : 2

<apex:page controller="LinkAccessController">
    <HTML>
        <HEAD>
        </HEAD>
        <BODY>
            <form action="https://test.com/"  method="POST" id="sessionPost"><br/><br/>  
               
                app Id
                <input type="text" name="app"  /><br/><br/> 
                
                session
                <input type="text" name="rsession"  /> <br/><br/>
                
                tokenID
                <input type="text" name="token"  /> <br/><br/>
                
                Redirect Required 
                <input type="text" name="redirectReq" placeholder="true" value="True"/><br/><br/>
                
                <script>document.getElementById('sessionPost').submit();</script>
                </form>
            </BODY>
        </HTML>
</apex:page>


Controller : 2
public with sharing class LinkAccessController {
// Some code is there..
// Here i want use the contact fields from first controller to do some operation
}