I have overriden a tab with Visualforce page. I have used standard controller and the following markup to display different views:

<apex:selectList value="{!filterId}" size="1">
    <apex:actionSupport event="onchange"  rerender="list"/>
    <apex:selectOptions value="{!listviewoptions}"/>

However, when I choose a view, click on a record and then press back button, the previous view is not preserved. I don't know how to handle this issue. Any idea or help with coding is appreciated. Note: since users should be able to create new views themselves, I don't want any hard-coded listviewoptions


Perhaps store the value selected by user in a browser cookie (salesforce provides methods to do this), and then have your page controller extension retrieve this cookie at page load and use it as initial list view option selected ie store it in filterId field and then retrieve initial list of results to present.

  • Alternately, use a querystring argument to pass the current listview ID around and, if present, default the listview to that ID ...
    – user735
    Jan 21 '15 at 22:51
  • @John Can you give any example code regarding the solution you suggested?
    – Leeuw Dijk
    Jan 22 '15 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.