Trying to get the values to my Controller that I can change the limit on the displayed List on my Page. I'm Using a dynamic query and everything is working fine but what's below. What am I'm missing?
If instead of selectOption
, I use CommandLink
that calls the same Action it works, but don't want that. I want selectOption
to work!
<apex:selectList value="{! PageSize }" size="1" id="resultLimit">
<apex:selectOption itemValue="5" itemLabel="5">
<apex:param value="5" name="5" assignTo="{!rowLimit}"/>
</apex:selectOption>
<apex:selectOption itemValue="5" itemLabel="5">
<apex:param value="5" name="5" assignTo="{!rowLimit}"/>
</apex:selectOption>
<apex:selectOption itemValue="10" itemLabel="10">
<apex:param value="10" name="10" assignTo="{!rowLimit}" />
</apex:selectOption>
<apex:selectOption itemValue="20" itemLabel="20">
<apex:param value="20" name="20" assignTo="{!rowLimit}" />
</apex:selectOption>
<apex:actionSupport event="onchange" reRender="results" action="{!resetList}" status="myStatus"/>
</apex:selectList>
On Controller :
public String rowLimit = '5';
public String getRowLimit() {
if (rowLimit == null || rowLimit == '') {
return '5';
}
else {
return rowLimit;
}
}
public void setRowLimit(String limitExp)
{
rowLimit = limitExp;
}
public void resetList () {
/* This Method Run the Dynamic Query and reset the List Table on Page */
}