You need to sign in to do that
Don't have an account?
Lionel_Castro
Global method in visualforce pages
Hi All,
I've a method in a global class and I need that this method to be visible in all my visualforce pages... How I can do it?
Thanks
I've a method in a global class and I need that this method to be visible in all my visualforce pages... How I can do it?
Thanks
Yes it is possible..
You can use one standardcontroller and then in extension you can all all your controllers which you want to use..
<apex:page standardcontroller="Account" extensions="controller1 controller2 controller3">
like I mentioned above you can sue space separted custom controllers...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
All Answers
What do you mean by visible in VF page ?
You can simply use action function to call these methods from page..
Thanks,
Sandeep
One VF page has got one controller, but if I got a global class and 2 VF pages, how I can call to global method in both pages? with action funcion? Can you put some example, please?
Thanks
there is no difference in calling a global class method or public method from Vf page..
Please refer dummy code for example...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
My code will be:
In this case the controllers can't extends other class...
Thanks again
If you want to extend another class from your controller then you can use extends keyword tpo extend...the class which you are extending should be public abstract class className..
please check with thsi and let me know if you need any clarification....
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
I need fix this issue without extend...it's possible?
Thanks
You mean you dont want to extend teh class from controller but you want to access them into page..which is something like you want to call more controllers from page instead of extending with class?
Thanks,
Sandeep
Thanks
Yes it is possible..
You can use one standardcontroller and then in extension you can all all your controllers which you want to use..
<apex:page standardcontroller="Account" extensions="controller1 controller2 controller3">
like I mentioned above you can sue space separted custom controllers...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Thanks,
Sandeep
Salesforce Certified Developer
WC !! feel free to reach out for more doubts..
thanks,
sandeep