It is not possible to define a VisualForce page with two entries in the standardController attribute. I would probably create a Custom Apex Controller with a reference to both objects and action methods to handle the two different save actions you wish to run, the main reason being that you wish to show lists of objects. Using a standard controller + extension really just confuses things since you have a bunch of functionality you won't need specific to only a small part of the data you interacting with.
public class MyController {
public List<Obj1> listOfObjs1 {get; set;} public List<Obj2> listOfObjs2 {get; set;} public Obj1 Obj11 {get;set;} public Obj2 customObj22 {get;set;}
public MyController() { listOfObjs1 = [Select id, name from Obj1]; }
public PageReference saveObj1() { // save logic } }
It is not possible to define a VisualForce page with two entries in the standardController attribute. I would probably create a Custom Apex Controller with a reference to both objects and action methods to handle the two different save actions you wish to run, the main reason being that you wish to show lists of objects. Using a standard controller + extension really just confuses things since you have a bunch of functionality you won't need specific to only a small part of the data you interacting with.
public class MyController {
public List<Obj1> listOfObjs1 {get; set;} public List<Obj2> listOfObjs2 {get; set;} public Obj1 Obj11 {get;set;} public Obj2 customObj22 {get;set;}
public MyController() { listOfObjs1 = [Select id, name from Obj1]; }
public PageReference saveObj1() { // save logic } }
It is not possible to define a VisualForce page with two entries in the standardController attribute.
I would probably create a Custom Apex Controller with a reference to both objects and action methods to handle the two different save actions you wish to run, the main reason being that you wish to show lists of objects.
Using a standard controller + extension really just confuses things since you have a bunch of functionality you won't need specific to only a small part of the data you interacting with.
public class MyController {
public List<Obj1> listOfObjs1 {get; set;}
public List<Obj2> listOfObjs2 {get; set;}
public Obj1 Obj11 {get;set;}
public Obj2 customObj22 {get;set;}
public MyController() {
listOfObjs1 = [Select id, name from Obj1];
}
public PageReference saveObj1() {
// save logic
}
}
https://salesforce.stackexchange.com/questions/48658/how-to-use-two-standard-controllers-in-a-single-visual-force-page
Thank you
Ajay Dubedi
All Answers
Yes you can have list of accounts and the list of related/child contacts on VF page using recordsetvar.
Refer below code for the same:- IF you want to have separate lists then you have to use extensions with standard controller for this.
It is not possible to define a VisualForce page with two entries in the standardController attribute.
I would probably create a Custom Apex Controller with a reference to both objects and action methods to handle the two different save actions you wish to run, the main reason being that you wish to show lists of objects.
Using a standard controller + extension really just confuses things since you have a bunch of functionality you won't need specific to only a small part of the data you interacting with.
public class MyController {
public List<Obj1> listOfObjs1 {get; set;}
public List<Obj2> listOfObjs2 {get; set;}
public Obj1 Obj11 {get;set;}
public Obj2 customObj22 {get;set;}
public MyController() {
listOfObjs1 = [Select id, name from Obj1];
}
public PageReference saveObj1() {
// save logic
}
}
https://salesforce.stackexchange.com/questions/48658/how-to-use-two-standard-controllers-in-a-single-visual-force-page
Thank you
Ajay Dubedi