You need to sign in to do that
Don't have an account?
actionSupport and selectList
<apex:selectList value="{!sortByAttr}" multiselect="false" size="1" >
<apex:selectOptions value="{!sortByOptions}"/>
<apex:actionSupport event="onchange" action="{!sortTheListings}" rerender="listingSearchResultsPanel" immediate='false' />
</apex:selectList>
The sortTheListings function is not invoked at all.
So I tried actionFunction
<apex:actionFunction action="{!sortTheListings}"
name="sortAgain" rerender="listingSearchResultsPanel" status='nextStatus' immediate='false' />
<apex:selectList value="{!sortByAttr}" multiselect="false" size="1" onchange="sortAgain()" >
<apex:selectOptions value="{!sortByOptions}"/>
</apex:selectList>
This time, the sortTheListings() call is made, but the new value of sortByAttr is not propagated to the controller.
I have all of this within apex:form tag. I also tried adding actionRegion around it.
Do let me know if you need additional code/information.
Any help will be greatly appreciated.
Regards
Pratima
Assuming not, please provide your page/controller (the more condensed but still exhibiting the problem the better) and use the SRC button in the toolbar. You can also read through this example if you haven't already which highlights much of what you are trying to do from what I can tell.
<apex:page controller="SampleResultsPageController" showHeader="false">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<body>
<apex:form>
<div id="page">
<div class="find2-cont">
<h2>Find Apps</h2>
</div>
<apex:outputPanel id='searchResultsPanel'>
<apex:actionFunction action="{!sortTheListings}"
name="sortAgain" rerender="listingSearchResultsPanel" status='nextStatus' immediate='false' />
<div id="search-res">
<apex:outputPanel id="searchResultsPagenationPanel" rendered="{!hasResults}">
<apex:actionStatus id="nextStatus" startText="(going to next page...)" stopText=""/>
<apex:outputPanel styleClass="sort">
<label>Sort by</label>
<apex:selectList value="{!sortByAttr}" multiselect="false" size="1" onchange="sortAgain()" >
<apex:selectOptions value="{!sortByOptions}"/>
</apex:selectList>
</apex:outputPanel>
</apex:outputPanel>
</div>
<apex:outputPanel id="listingSearchResultsPanel">
</apex:outputPanel>
</apex:outputPanel>
</div>
</apex:form>
</body>
</html>
</apex:page>
I realized that if I remove the "transient" keyword on the results attribute of the controller, it works.