row not delete when click on delete hyperlink what i'm doing wrong.
apex class
public class ActionFunctionDeleteEditControllerDeleteEditController{
public List<Stud__c> contacts{get;set;}
public String conId{get;set;}
public ActionFunctionDeleteEditControllerDeleteEditController(){
contacts = new List<Stud__c>([Select Id, Name__c, Email_Address__c from Stud__c]);
}
public PageReference remove(){
integer index = 0;
for(Stud__c con : contacts){
if(con.Id == conId){
contacts.remove(index);
break;
}
index ++ ;
}
return null;
}
}
VFPAge
<apex:page controller="ActionFunctionDeleteEditController">controller="DeleteEditController">
<apex:form >
<apex:actionFunction name="Remove" action="{!remove}" rendered="rm">
<apex:param name="arg" value="" assignTo="{!conId}"/>
</apex:actionFunction>
<apex:pageBlock id="rm">
<apex:pageblockTable value="{!contacts}" var="co">
<apex:column headerValue="Delete Record">
<a href="#" onClick="remove('{!co.Id}');">Delete</a></apex:column>
<apex:column value="{!co.Name__c}"/>
<apex:column value="{!co.Email_Address__c}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>