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
raju.Braju.B 

Hi Need popup menu

Hi,

I displayed all records of an custom object.

 

when i placed mouse pointer(Mouseover) on a particular record. It need to display that record details as a popup menu.

I wrote a code in visulaforce page to display that particular records.

Please help me out.

 

Raju.b

kiranmutturukiranmutturu

try this

 

<apex:page standardController="account" recordSetVar="accounts">
<script>
function conme(item){
    //alert(item);
    window.open(x);
}
</script>
 <apex:form>
     <apex:pageBlock>
         <apex:pageBlockTable value="{!accounts}" var="a" rows="5">
             <apex:column value="{!a.name}" onmouseover="conme('{!a.id}');"/>
         </apex:pageBlockTable>
     </apex:pageBlock>
 </apex:form>
</apex:page>

 

 

 

raju.Braju.B

Hi kiran,

Thanks for treply.

I have tried with your code..but it is not working fine

 

can you make sure of that code?

 

Raju.b

kiranmutturukiranmutturu

wats wrong from your side? i am getting it

goabhigogoabhigo

I am not sure with that you were able to open a pop up, because var x = 'https://c.ap1.visual.force.com/'+item; looks wrong!!!


Try this;


var x = 'https://c.ap1.visual.force.com/apex/UrPageName?id=' + item;


Also please note where your instance is located(can be seen in address bar). Here its in ap1. There are other servers by salesforce like na1,na2....


kiranmutturukiranmutturu

as u need to display the detail record its not required the page name and all,......

goabhigogoabhigo

Raju has written a VF page to display the details. I hop he wants to display that VF page in popup. Raju,correct me if I am wrong.

lescclarkcpdlescclarkcpd

hi

 

this pops up as a new window which remains open after you move the cursor off of the line - it would be better if it only remained open whilst hovering over.  any suggestions ?

goabhigogoabhigo

I think you have to write javascript function to close the window onmouseout(or something similar).

raju.Braju.B

Hi,

thanks for the rply.

Can i have a snippet.

So that it would be help full to me.

 

 

goabhigogoabhigo

Ok, here you go:

 

<script>
var newWin;
 function openWin(item)
 {
  var url="/apex/UrPageName?id="+item;
  newWin=window.open(url, 'Popup','height=500,width=800,left=200,top=100');
  newWin.focus();
 } 
 function closeWin()
 {
   newWin.close();  
 }
 </script>
<apex:form>
     <apex:pageBlock>
         <apex:pageBlockTable value="{!accounts}" var="a" rows="5">
             <apex:column value="{!a.name}" onmouseover="openWin('{!a.id}');" onmouseout="closeWin();"/>
         </apex:pageBlockTable>
     </apex:pageBlock>
 </apex:form>
</apex:page>

 You might need to edit some codes. It works.

 

 

raju.Braju.B

Hi,

I worked on it didn't get work..

 

If u don't mind can you send me your mailID.

So,that i can send u mail a screenshot of my requirement.

 

Thanks,

Raj.b