Saturday, 11 August 2012

Displaying pop-up summaries on hover in visualforce

VF:
<apex:page controller="PopupTest19">  
    <apex:form >  
        <apex:repeat value="{!accounts}" var="acc">                              
                
      <a href="{!acc.Id}" id="{!acc.Id}" onblur="LookupHoverDetail.getHover('{!acc.Id}').hide();" onfocus="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();" onmouseout="LookupHoverDetail.getHover('{!acc.Id}').hide();" onmouseover="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();">{!acc.Name}</a><br/> 
        </apex:repeat>  
    </apex:form>  
    </apex:page>
APEX:
public with sharing class PopupTest19 { 
List<Schema.account> accounttList = new List<Schema.account>();     
    public List<Schema.account> getAccounts()      {  
        
        accounttList = [Select Id, Name from Account LIMIT 10];  
        return accounttList ;  
    }  
  
}
//List<Schema.account> if apex class has same name as standard object to avoid that confusion we have to use Schema before standard Object name otherwise an error will occur 'Illegal assignment from LIST<Account> to LIST<Account>'
Refer:
Displaying pop-up summaries on hover in visualforce

1 comment:

  1. Hi how to show it on a standard field of account detail page ?

    ReplyDelete

Labels