Visualforce页面调用后台Controller中的方法,常用的有以下几种:
(1)Action
public void search_product(){
...
}
<apex:commandButton style="position: relative;left:5px;bottom:2px;" id="searchId" value="Search" action="{!search_product}" reRender="entryListTableParent,labelSearch,ConsoleInfo" status="loading"/>
(2)ActionFunction
调用声明需要写在apex:form里面,方法的返回为PageReference ,
<apex:form>
.....
<apex:actionFunction action="{!search_product2}" name="search_product2"
reRender="entryListTableParen,ConsoleInfo" status="loading">
</apex:actionFunction>
......
</apex:form>
其中action对应的是Controller中的方法,name可以再js里面直接调用,