Skip to main content
In how many ways we can pass the parameter from one VF page to Another VF page?

How to pass the pameter from one VF page to Another VF page when both use same controller and

how to pass if they dont use the same controller? any sample VF page code controller will be highly appreciated?
1 件の回答
  1. 2015年6月5日 16:39

    there are mainly two ways to pass parameters

    • As url parameters . this works with any page and controller
    • Other is using a shared controller (only works if both pages has the  exact same conrollers and extensions

    url parameters

     

    public Pagereference gotonewpage()

    {

    PageReference pageRef = Page.existingPageName;

    pageRef.getParameters().put('msg','success');

    return PageRef

    }

    shared controller

    public Pagereference gotonewpage()

    {

    PageReference pageRef = Page.existingPageName;

    pageref.setRedirect(false)

    return PageRef

    }

    when you share the contoller you can access all the class varables of the shared controller 

    pageref.setRedirect(false) specify not to reset values on page redirect

     
0/9000