2

What is "ListViewport"? I saw that some users use this object. And I can only guess that it is a JavaScript object. But I have found no official description for it.

Any ideas?

Example from the stack forum: ListViewport.instances[get('myId')].refreshList();

1 Answer 1

7

You must have seen ListViewPort in my question in the forum. I discovered ListViewPort while using Inspect Element on a Salesforce List View Refresh button, in Google Chrome. Hence, it is not a fail-safe approach.

refreshList() is a JavaScript function (written by Salesforce) to refresh a ListView. I found this functionality useful because my Apex Class makes changes on a button click, and I wanted the changes to reflect without refreshing the whole page, i.e., without using location.reload().

The get function (written by me) is get the URL parameter value.

E.g.
ListViewport.instances[get('fcf')].refreshList()
will execute
ListViewport.instances['00B90000003oVDE'].refreshList()
in one of my pages: https://ap1.salesforce.com/a00?fcf=00B90000003oVDE

Just in case you need it, here is the code to my get() function:

function get(name) { 
    if (name = (new RegExp('[?&]' + encodeURIComponent(name) + 
            '=([^&]*)')).exec(location.search)) { 
        return decodeURIComponent(name[1]); 
    } 
}

And here is the screenshot of the element inspection:

enter image description here

2
  • 1
    Many thanks for your answer bro! Very cool idea to use undocumented functionallity. Commented Dec 11, 2012 at 17:51
  • 1
    Plenty of undocumented but useful Salesforce functionality out there. We should never use them - they can stop working without notice. I use them in my DEV org only. Commented Dec 23, 2012 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .