• PGN
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi,
         I would like to invoke an action method on a controller when the user changes the value of a selectList.
So I have the following code in my page:
 

<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

 

  • October 02, 2008
  • Like
  • 0
My org has translation workbench enabled and all the labels, picklist values and messages are translated to different languages. I would like to develop a Visualforce page that shows data collected from several objects in the user's language. Most of the information can be reached using merge fields without programming a controller extension, but merge fields that reference picklist values show  the master value, not the label in the user's language, is there any way to translate the picklist value using merge fields, something like "tolabel"? If not, I presume that I will have to develop a controller extension and use Describe functions, or is there any other easier way?
Hi,
         I would like to invoke an action method on a controller when the user changes the value of a selectList.
So I have the following code in my page:
 

<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

 

  • October 02, 2008
  • Like
  • 0