Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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();

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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

share|improve this answer
1  
Many thanks for your answer bro! Very cool idea to use undocumented functionallity. –  mast0r Dec 11 '12 at 17:51
    
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. –  Suman Krishna Saha Dec 23 '12 at 8:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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