Custom Tab Title and Icon together in visualforce page!

<apex:page standardcontroller="Account" showHeader="true" sidebar="true" tabStyle="Account">
<apex:pageMessages />
<apex:sectionheader title="{!$ObjectType.Account.label} Detail" subtitle="{!Account.Name}"/>
<chatter:feedwithfollowers entityId="{!Account.Id}"/>
<apex:includeScript value="/support/console/30.0/integration.js"/>
<script type="text/javascript">
window.onload = function onloadJS()
{
//alert('INIT');
if (sforce.console.isInConsole())
{
//alert('in console');
sforce.console.setTabTitle('{!Account.Name}');
sforce.console.getEnclosingPrimaryTabId(setTabIcon);
}
else
{
//alert('not in console');
}
function setTabIcon(result)
{
sforce.console.setTabIcon('/img/msg_icons/confirm16.png', result.id, checkResult);
}
function checkResult(result)
{
if (result.success)
{
//alert('Tab icon set successfully!');
}
else
{
//alert('Tab icon cannot be set!');
}
}
}
</script>
</apex:page>

Comments