function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AnushaAnusha 

Record Information when mouse is hovered

hi Guys,

 

In one of my requirement

i want  to display record information when mouse is hovered

 

Please any one help me it's very urgent

Best Answer chosen by Admin (Salesforce Developers) 
samarsamar

Hi Anusha,

Are talking about mini page layout, the window popout when you hover on the lookup field value in standard salesforce pages?

All Answers

Hari@RockzsHari@Rockzs

page

 

<apex:page controller="Enametable">
     <apex:form >
      <p/>
      Department:
      <apex:selectList value="{!Department}" multiselect="false" size="1">
          <apex:selectOptions value="{!DeptName}"/>
      </apex:selectList><p/>
      <apex:commandButton action="{!DeptName}" value="GetEmployees" reRender="out" status="mystatus"/>
     <p/>
     Employees are :
        <apex:outputPanel id="out">
        <apex:dataTable value="{!Employees}" var="emp" bgcolor="cyan" border="2">
        <apex:column headerValue="EmployeeName">
        <apex:actionSupport event="onmouseover" rerender="detail" status="Mystatus">
        <apex:param name="cid" value="{!emp.id}"/>
        </apex:actionSupport>
         {!emp.EmployeeName__c}
        </apex:column>
        </apex:datatable>
        </apex:outputpanel>
         <apex:actionstatus id="Mystatus" starttext="loadind data.....">
         <apex:facet name="stop">
        <apex:outputPanel id="detail">
        <apex:detail subject="{!$CurrentPage.parameters.cid}" relatedList="true"  title="false"/>
          </apex:outputPanel> 
          </apex:facet>
          </apex:actionStatus>

     </apex:form>
</apex:page>
Controller:
public class Enametable {

   
public PageReference DeptName()
    {
        return null;
    } 

 public String Department { get; set; }

        List<Employees__c> Employees ;
        
        public List<Employees__c> getEmployees() {
               system.debug(Department);
               if(department != null)
               {
                Department__C objdept = [select Id from Department__c where name =: department];
                system.debug(objdept.Id);
                Employees = [select EmployeeName__c from Employees__c where DeptName__c=:objdept.Id];
                return Employees;
                
             }
             return null;
        }
        
  List<Department__c> lstdept;

    public List<selectOption> getDeptName()
    {
    List<selectOption> options = new List<selectOption>();
    
    lstdept = [select Name from DepartMent__c];
    
    options.add(new SelectOption('--None--','--None--'));
    
    for(Department__c obj : lstdept)
    {
            options.add(new Selectoption(obj.Name,obj.Name));
    }
    return options;
    }

}
I worked with this code,after u have select departmentname from picklist ,click buttonthen u can get all employees who are belongs to that department then when u mousehoverd on employee name,employee detail page will displayed
samarsamar

Hi Anusha,

Are talking about mini page layout, the window popout when you hover on the lookup field value in standard salesforce pages?

This was selected as the best answer
AnushaAnusha

No not like that,

when we hover the mouse in record some test have to display.

like 'please click here to see more Info'

will it possible .?

samarsamar

ofcourse it is posible if it is a visualforce page. Simply apply the modal window concept using css and javascript.