You need to sign in to do that
Don't have an account?
bobby7
How can i hide "Recentley viewed cases" in list view when i am developing a VF page using any java script.
I want to remove this highlighted one "Recently viewed cases" from that drop down when i am using apex:listViews
I am done with this code. This is working fine for me. I had included some Javascript in below page which is highlighted. That makes my result very easy.
<apex:page showHeader="true" tabstyle="Case" id="thePg">
<apex:stylesheet value="/sCSS/21.0/sprites/1297816277000/Theme3/default/gc/versioning.css" />
<apex:stylesheet value="/sCSS/21.0/sprites/1297816277000/Theme3/default/gc/extended.css" />
<style>
.actionColumn{ display: none; visibility:hidden;}
</style>
<apex:sectionheader title="Home" subtitle="My Support Cases" />
This is the replacement page for the user's support cases.
<br></br>
<br></br>
<apex:listViews type="case" id="lstView">
<apex:facet name="header"> </apex:facet>
</apex:listViews>
<apex:enhancedList listid="00B90000003QAdm" customizable="false" rowsPerPage="25" rendered="true" height="600" />
<!------
<apex:ListViews Id="PortalMyCases" rendered="true" type="Case">
<apex:facet name="header"><br></br>This is the header<br></br><br></br></apex:facet>
<apex:facet name="footer">This is the footer</apex:facet>
</apex:listViews>
----->
<script>
var listVal = document.getElementById('{!$component.lstView}:fcf');
console.log(listVal);
if( listVal )
{
var options = listVal.options;
for(i=0; i<options.length;i++)
{
console.log(options[i]);
if( options[i].text == 'Recently Viewed Cases' )
options[i].remove();
}
}
</script>
</apex:page>
All Answers
try this link.
http://salesforce.stackexchange.com/questions/1852/how-do-i-get-a-selectlist-in-my-vf-page-for-a-custom-case-controller-to-work
Anyway, here's an example of enhanced list views in action http://salesforcetutorials.wordpress.com/2012/02/01/enhanced-list-views-on-a-visualforce-page/
You mentioned Javascript you could try either using something like GreaseMonkey and when the standard page renders rip out that pick list value. You could add the JS to your Enhanced List View VF page which rips out the value from the pick list post render, or you could try some JavaScript injections - render the custom left nav on every page and then in there have the JS that rips out the value. Seems like a lot of work, but if you're handing with JS and you don't mind screenscraping/manipulating the HTML post-render it's possible. Of course Salesforce doesn't support anything like this so you may have to re-write between upgrades/versions.
Good luck!
I am done with this code. This is working fine for me. I had included some Javascript in below page which is highlighted. That makes my result very easy.
<apex:page showHeader="true" tabstyle="Case" id="thePg">
<apex:stylesheet value="/sCSS/21.0/sprites/1297816277000/Theme3/default/gc/versioning.css" />
<apex:stylesheet value="/sCSS/21.0/sprites/1297816277000/Theme3/default/gc/extended.css" />
<style>
.actionColumn{ display: none; visibility:hidden;}
</style>
<apex:sectionheader title="Home" subtitle="My Support Cases" />
This is the replacement page for the user's support cases.
<br></br>
<br></br>
<apex:listViews type="case" id="lstView">
<apex:facet name="header"> </apex:facet>
</apex:listViews>
<apex:enhancedList listid="00B90000003QAdm" customizable="false" rowsPerPage="25" rendered="true" height="600" />
<!------
<apex:ListViews Id="PortalMyCases" rendered="true" type="Case">
<apex:facet name="header"><br></br>This is the header<br></br><br></br></apex:facet>
<apex:facet name="footer">This is the footer</apex:facet>
</apex:listViews>
----->
<script>
var listVal = document.getElementById('{!$component.lstView}:fcf');
console.log(listVal);
if( listVal )
{
var options = listVal.options;
for(i=0; i<options.length;i++)
{
console.log(options[i]);
if( options[i].text == 'Recently Viewed Cases' )
options[i].remove();
}
}
</script>
</apex:page>