Skip to main content

For some reason, getmycust() method is getting called as soon as the page loads. Can somebody please tell me where am I going wrong.

<apex:page standardController="Reservation__c" extensions="CarSharingClass">

<apex:commandButton value="Show Fahrzeuge" action="{!showPanel}" / >

// I want to show the table only when the button is clicked.

<apex:pageBlockTable value="{!myCust}" var="showFahr" rendered="{!If(myCust != null && myCust.size>0 && isRendered==true ,true,false)}" >

</apex:pageBlockTable>

</apex:page>

Class

public class CarSharingClass {

public PageReference showPanel(){

isRendered = true;

return null;

}

public List<Fahrzeuge__c> getMyCust() {

}

}

 
2 respuestas
  1. 5 ene 2017, 17:11
    It is being called because it is a getter for a value on the page. Your markup of '{!myCust}' translates server side to invoking 'getMyCust', so in order to render the page the VF engine has to invoke your method.
0/9000