Q:

Can apex:param pass null for Integers?

I'm trying to reset an Integer value to null, but it is converted to 0.
<apex:actionFunction action="{!doSomething}" name="doSomething" rerender="nothing">
    <apex:param name="indexValue" assignTo="{!index}" value="{!NULL}" />
</apex:actionFunction>

public class MyController{
    public Integer index { get; set; }

    public void doSomething() {
        System.debug(index);
    }
}

Is there way to set it to null?

A:

It looks like the problem is that when the parameter comes over as an empty string, salesforce converts the value to 0 instead of NULL. You could consider setting the value of index in your method based on the param value string:
public void doSomething() {
    String ParamValue = Apexpages.currentPage().getParameters().get('indexValue');
    index = ParamValue == '' ? NULL : Integer.valueOf(ParamValue);
    System.debug(index);        
}

