+ Start a Discussion
bpl3792bpl3792 

Standard controller in a component?

I'm trying to create a workflow in a visualforce page and feel the components would help out tremendously because of the "rendered" option. What I'm trying to do is make a component visible when certain answers are returned. Is there a way to use standard controllers in a component or will I need to build the controls from scratch?

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The only way that you can use a standard controller in a component is to pass it in from the parent page as a parameter.  However, this breaks the re-usability of the component.

 

You're almost certainly better using attributes on the component to pass through data from the standard controller.  You can also pass through action methods (if you want to execute a save on the standard controller, for example).

All Answers

Shashikant SharmaShashikant Sharma

No you can not use Standard Contrllers in components , Standard Contrllers are only used in VFP not in Components.

bob_buzzardbob_buzzard

The only way that you can use a standard controller in a component is to pass it in from the parent page as a parameter.  However, this breaks the re-usability of the component.

 

You're almost certainly better using attributes on the component to pass through data from the standard controller.  You can also pass through action methods (if you want to execute a save on the standard controller, for example).

This was selected as the best answer
bpl3792bpl3792

Thanks. I'm new to visualforce so I'm trying to figure out my options.