public with sharing class passparameters1control {
public customer__c p { get; set; }
public passparameters1control (){
p=new customer__c();
}
public PageReference nextpage() {
PageReference pr=new PageReference ('/apex/t42passparametpage2?name='+p.First_name__c+'&lastname='+p.Lastname__c);
return pr;
}
}
public with sharing class passparameters1control {
public customer__c p { get; set; }
public passparameters1control (){
p=new customer__c();
}
public PageReference nextpage() {
PageReference pr=new PageReference ('/apex/t42passparametpage2?name='+p.First_name__c+'&lastname='+p.Lastname__c);
return pr;
}
}
Please check the below sample code for how to pass parameters form one vf page to another page.
Page1:
Controller
Page2
Controller
Hope this helps you!
Best Regards,
Jyothsna
All Answers
You can simply pass the parameters with names and then with same names you can get those in apex classes.
if you want to pass id or status in one page then pass it like below. You need to frame the URL which will consists the label and value.
URL: apex/demopage?Id='12121212'&status='completed'.
in constructor you can use following code to get the values from URL.
public void demopagecontroller()
{
String strStatus = apexpages.currentpage().getparameters().get('status');
String strId = apexpages.currentpage().getparameters().get('id');
}
Let me know if it helps you.
Thanks
Please check the below sample code for how to pass parameters form one vf page to another page.
Page1:
Controller
Page2
Controller
Hope this helps you!
Best Regards,
Jyothsna