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
Sakti Sahoo 5Sakti Sahoo 5 

Getting Field Values on Mouse Hover in Pageblocktable row

HI,

Can it be possible, whenever I am doing mouse hover in a row present in the pagseblocktable, it will capture the record id as well as other field values present in that row.

Thanks,
SAKTI
Best Answer chosen by Sakti Sahoo 5
Sakti Sahoo 5Sakti Sahoo 5
I solved this by following:

On VF Page,


function Test(vname,vid)
    {
     
        alert("Name of the record is "+ vname + " and the record id is " +vid);
   
    }


<apex:form id="frm_id" >
        <apex:pageBlock id="pgblk_id">  

                <apex:pageBlockTable value="{!incidents}" var="Inc" id="tbl_id" border="1" onRowClick="Test('{!Inc.name}','{!Inc.Id}')">
                                              
                <apex:column headerValue="Name" id="clm_id" >
                  
                    <apex:outputLink value="javascript:void(0);" onclick="window.open('/{!Inc.id}');"></apex:outputLink>
                   
                 </apex:column>
................
..................
.................
</apex:page>
 

All Answers

Asha KAsha K

Hi,
It is possible. Please ifnd the below sample code.

<apex:page standardController="Case" recordSetVar="usr" >
<apex:pageBlock >
        <apex:pageBlockTable value="{!usr}" var="usa" id="usrblock">
            <apex:column headerValue="Name"  >               
                <a id="{!usa.Id}"
                    onmouseover="LookupHoverDetail.getHover('{!usa.Id}', '/{!usa.Id}/m?retURL={!usa.Id}&isAjaxRequest=1').show();"
                    onmouseout="LookupHoverDetail.getHover('{!usa.Id}').hide();"
                    onfocus="LookupHoverDetail.getHover('{!usa.Id}', '/{!usa.Id}/m?retURL={!usa.Id}&isAjaxRequest=1').show();"
                    onblur="LookupHoverDetail.getHover('{!usa.Id}').hide();"
                    href="/{!usa.Id}"> 
                    {!usa.Id}
                </a>           
            </apex:column>
           
        </apex:pageBlockTable>
</apex:pageBlock>       
</apex:page>
 

Sakti Sahoo 5Sakti Sahoo 5
Thanks Asha. 

Sorry for the late reply. I was out of station. As per your suggestion, it shows me mouseover mini page layout.
But what I need was, I have a detail page layout just below the list view. When I just pass mouse pointer over a record, it will capture the record field details and will show in the detail page below.

Mouse Pointer selection
Here let say I just pass the pointer to the fist record. Now as per my code, it changes the record by yellow color. The fields that available in the record, should be display to my another detail vf page. Here the detailed page, I am capturing through iframe.

Thanks,
SAKTI
 
Sakti Sahoo 5Sakti Sahoo 5
I solved this by following:

On VF Page,


function Test(vname,vid)
    {
     
        alert("Name of the record is "+ vname + " and the record id is " +vid);
   
    }


<apex:form id="frm_id" >
        <apex:pageBlock id="pgblk_id">  

                <apex:pageBlockTable value="{!incidents}" var="Inc" id="tbl_id" border="1" onRowClick="Test('{!Inc.name}','{!Inc.Id}')">
                                              
                <apex:column headerValue="Name" id="clm_id" >
                  
                    <apex:outputLink value="javascript:void(0);" onclick="window.open('/{!Inc.id}');"></apex:outputLink>
                   
                 </apex:column>
................
..................
.................
</apex:page>
 
This was selected as the best answer