You need to sign in to do that
Don't have an account?

Should I use component attributes or some other method?
I am in the process of converting one of my VF pages to a component so that it can be easily reused across objects.
In my VF page I implement a standard controller with an extension class. The constructor of my extension class pulls in the record from the standard controller so I can perform some describe methods on it:
public myControllerExtension(ApexPages.StandardController controller) { Schema.DescribeSObjectResult objDescribe = controller.getRecord().getSObjectType().getDescribe(); ... }
What is the best way to replicate this in the component controller? I'm aware that the component controller does not have access to the standard controller, with the exception of using attributes to pass some information in. Are attributes the right way to go? Would I use an extension class in my page to generate the necessary values to assign to my controller attributes?
Thanks in advance for your assistance!
I actually have an extension class for the very purpose of communicating with my components when I need to. It's simple:
Then, I name that as an attribute in my component so I can pass in my record via the standard controller. The great part is, it gives me component-level access to {!save}, {!cancel}, {!delete}, {!view}, and so on. Those six lines of code above give you a great standardization point.
All Answers
I actually have an extension class for the very purpose of communicating with my components when I need to. It's simple:
Then, I name that as an attribute in my component so I can pass in my record via the standard controller. The great part is, it gives me component-level access to {!save}, {!cancel}, {!delete}, {!view}, and so on. Those six lines of code above give you a great standardization point.