Skip to main content
Sruthi M (Dev) 님이 #Visualforce에 질문했습니다
Can somebody please explain me what is the difference between calling a method in apex class from command button and calling an apex class method from javascript

Thanks in Advance...
답변 1개
  1. 2015년 12월 15일 오전 8:18
    There's no difference from the Apex side. The difference is all in the front end markup. A commandbutton allows you to call an apex action method when the button is pressed, but under no other circumstances. An actionfunction allows you to execute an apex action method via JavaScript and can thus be used in a number of different scenarios. You could emulate a command button via a regular HTML button with an onclick handler that invokes an actionfunction, but the commandbutton standard component means you don't have to!
0/9000