You need to sign in to do that
Don't have an account?
Mateo Alcauter
how to call a function on page load
I have this button that calls a function. How can i call this function (filterTransactions) when the page first loads?
I tried this, but it does not work.
<apex:page controller="CommunityPostedTransactionsController" action="{!filterTransactions}" showHeader="false" sidebar="false" cache="false">
Here is the button code:
<apex:commandButton action="{!filterTransactions}" value="Filter" rerender="output,selectListPanel, exportCSV" immediate="false"></apex:commandButton>
I tried this, but it does not work.
<apex:page controller="CommunityPostedTransactionsController" action="{!filterTransactions}" showHeader="false" sidebar="false" cache="false">
Here is the button code:
<apex:commandButton action="{!filterTransactions}" value="Filter" rerender="output,selectListPanel, exportCSV" immediate="false"></apex:commandButton>
You can't have DML in a method called from an Action invocation, but I think that throws you a very specific message to that effect.
You might be able to use an ActionFunction to do this? An Actionfunction lets you tie an apex method call to a javascript function, so you can then call the actionfunction (javascript method) from your favourite page onload() method (normal markup or jQuery if you fancy).