In my code the parameter in an apex:param does not get passed on to the controller. Here is the code for Visualforce:
<apex:Outputpanel>
<apex:variable value="{!1}" var="row"/>
<apex:repeat value="{!list}" var="item">
<apex:commandLink value="Action" action="{!performAction}">
<apex:param value="{!row-1}" assignTo="{!pos}"/>
</apex:commandLink>
<apex:variable value="{!row+1}" var="row"/>
</apex:repeat>
</apex:Outputpanel>
Controller:
public Integer pos {get; set;}
public PageReference performAction() {
if (list[pos] != null){
delete list[pos];
}
list.remove(pos);
return null;
}
So what is wrong here?
<apex:actionSupport>
along withrerender
to accomplish a partial page refresh instead of specifying theaction
attribute in your<apex:commandLink>
.