i created a visualforce page in which there is a code segment
<apex:column ><apex:commandButton value="{!if(item.i == size-1,'Add','Delete')}" action="{!if(size == 1,addElement(),removeElement())}"></apex:commandButton></apex:column>
i created a custom controller containing function
public PageReference addElement(){
return null;
}
public PageReference removeElement(){
return null;
}
but when i try to save the visualforce page it is giving me error
Error: Unknown function addElement. Check spelling
can any one please tell me how to use if structure in action attribute so that it will properly work