I have a function inside my apex controller :
public List<Decimal> getcheckProductMaxMinPrice(){
List<Decimal> listDeci = new List<Decimal>();
listDeci.add(5.0);
listDeci.add(7.0);
System.debug('Called ! ');
return listDeci;
}
When I call it from my JS function inside my VF page :
<apex:commandLink action="{!addToTable}" oncomplete="doneAdding();" />
function doneAdding(){
console.log("DEBUG : ",{!checkProductMaxMinPrice});
}
on my debug log in apex :
The only one call to my apex function "getcheckProductMaxMinPrice" is when I reloading the page.
When I hit the commandLink button - my apex function is never called.
Which means that the " System.debug('Called ! ');"
will be printed on the screen only when I refresh the page (Calling the constructor) but not when I hit the commandLink button and the line console.log("DEBUG : ",{!checkProductMaxMinPrice});
in my JS function is not calling the function even though I have a get before my function name.
So actually I have 2 questions here :
Why the function in my apex controller is called when I reload the page, if I call it ONLY when I hit the commandLink button?
Why this line :
console.log("DEBUG : ",{!checkProductMaxMinPrice});
does not call the function in my apex Controller?
Thanks!