+ Start a Discussion
aks001aks001 

recordSetVar ??

HI there,

it's really confusing that how it is picking values by using {!filterId}
expression selectList component???

<apex:page standardController="Case" recordSetvar="cases">
    <apex:pageBlock >
        <apex:form id="theForm">
            <apex:panelGrid columns="2">
                <apex:outputLabel value="View:"/>
                <apex:selectList value="{!filterId}" size="1">
                    <apex:actionSupport event="onchange" rerender="list"/>
                    <apex:selectOptions value="{!listviewoptions}"/>
                </apex:selectList>
            </apex:panelGrid>
            <apex:pageBlockSection >
                <apex:dataList var="c" value="{!cases}" id="list">
                    {!c.subject}
                </apex:dataList>
            </apex:pageBlockSection>
        </apex:form>
    </apex:pageBlock>
</apex:page>

if anyone knows it there than please update me..... thanks.. in advance :)

Best Answer chosen by Admin (Salesforce Developers) 
souvik9086souvik9086

It is the in built salesforce functionality that comes with standard controller. 

It will display the salesforce pre-defined options for the selectoptions by the variable "listviewoptions".

And they internally manage the selected value(selectlist) with the variable "filterId".

 

#Note: If you want some custom value in the picklist then you need to use an extension and in that controller you can define your selectoption and selectlist.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

All Answers

Dhaval PanchalDhaval Panchal

refer below example

 

Page:

<apex:page standardController="Account" recordSetVar="accounts" extensions="recordSetVarController">
<apex:form >
<apex:pageBlock >
    
    <apex:pageBlockTable value="{!accounts}" var="a" >
        <apex:column value="{!a.Id}"/>
        <apex:column value="{!a.name}"/>
    </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 Controller

public class recordSetVarController {
    public List<Account> obj{get;set;}
    public string str{get;set;}
    public recordSetVarController(ApexPages.StandardSetController controller) {
        obj = (List<Account>) controller.getSelected();
    }
}

 

souvik9086souvik9086

It is the in built salesforce functionality that comes with standard controller. 

It will display the salesforce pre-defined options for the selectoptions by the variable "listviewoptions".

And they internally manage the selected value(selectlist) with the variable "filterId".

 

#Note: If you want some custom value in the picklist then you need to use an extension and in that controller you can define your selectoption and selectlist.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

This was selected as the best answer
aks001aks001
thanks... for the explanation :)
souvik9086souvik9086

If the post helps you, then throw KUDOS by clicking on the star icon on the left. This will help other users to search.

 

Thanks

PreeSFDCDevPreeSFDCDev
Hi,I have created Listview options as mentioned above using recordset var and listviewoptions.
However is it possible to retain the last selected  option in the list view .For ex : I have a tab names XYZ accounts which overrides accounts. There are three option in my listview like All account, Closed account and open accounts and If I have selected Open account it displays all the open accounts. Then I clicked on some other tab.Now if I again click on XYZ accounts, it should display the listview with "Open Account" options. However it is not happening. It is displaying list view with All accounts option. Pls reply
 
Sreenath ReddySreenath Reddy
Hi,

May i know what is the use of recorsetvar actually.?
Cloud MuraliCloud Murali
we will have controll on eatch record set, so that we can do whatever the manupulation we can do.
www.cloudmurali.com