+ Start a Discussion
Tom M422Tom M422 

VisualForce Page navigation question . One page to another

I'm relatively new to VisualForce Pages and I'm trying to navigate through a series of pages  necessary to complete a long application. The pages are bult against different custom objects and I'm trying to figure out how to go from one page to another where the second page represents a different object. 

 

Any suggestions ?


Thanks


Tom

Ritesh AswaneyRitesh Aswaney

PageReference pgRef = new PageReference('/apex/NextVisualforcePage?id=' + opp.Id); //opp is an eg - use relevant var

pgRef.setRedirect(true);

return pgRef;

 

If your action method in Controller for the current VF Page returns that, you would be re-directed to the next page when the call returns.

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_pages_pagereference.htm

b-Forceb-Force

use one controller for all VF pages, which will help you form maintaining view state and variables

 

Thanks,

Bala