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
saiisaii 

By using the hyperlink to open a page has pop up (resizeable visualforce page)

Hi

I have created  On visualforcepage and it is calling thecontroller when Page excuted .and its working fine.

Now i have created a formula field hyperlink  . when i click on that hyperlink it is opening  in a new  window but now my requirement is when i click on the hyperlink should open has the Pop up Page .Please help me

 

HYPERLINK("/apex/Activity?id="+Id+"",' [Comments]').

 

 

thanks in advance

asish1989asish1989

Hi

   For Popup you can refer this code...

My Visualforce page

<apex:page controller="tstpopup">
    <apex:form >
        <apex:commandButton value="Show Pop up" action="{!showPopup}" rerender="tstpopup"/>
        <apex:pageBlock >
            This is just filler text from the Salesforce General. 
        </apex:pageBlock>
 
        <apex:outputPanel id="tstpopup">
        <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
                This is where I would put whatever information I needed to show to my end user.<br/><br/><br/>
                <apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="tstpopup"/>
            </apex:outputPanel>
        </apex:outputPanel>
 
    </apex:form>
 
    <style type="text/css">
        .custPopup{
            background-color: white;
            border-width: 2px;
            border-style: solid;
            z-index: 9999;
            left: 50%;
            padding:10px;
            position: absolute;
            /* These are the 3 css properties you will need to change so the popup 
            displays in the center of the screen. First set the width. Then set 
            margin-left to negative half of what the width is. You can add 
            the height property for a fixed size pop up if you want.*/
            width: 500px;
            margin-left: -250px;
            top:100px;
        }
        .popupBackground{
            background-color:black;
            opacity: 0.20;
            filter: alpha(opacity = 20);
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 9998;
        }

    </style>
</apex:page>

My controller is.

public class tstpopup {  
       
public boolean displayPopup {get; set;} 
           
 public void closePopup() {   

           
  displayPopup = false;  
      }        
 public void showPopup() 
{                
displayPopup = true;  
      }   
   }

 Did this post answers your questions if so please mark it solved so that others get benifited.

 

   Thanks

saiisaii

Hi

asish1989

 

thanks for reply
Actualy ur  code will show pop up  when click on the button but my requorement is when i click on the  hyperlink formula field  then it must open has pop up window

can u please tell me how to use it... thanks in advance  . i am nt using any button in my page.......

please help me thanks in advances

 

harsha__charsha__c

Hi saii

 

Opening a popup window using a hyperlink formula field is  not possible.

 

For your reference, you can go through this

https://ap1.salesforce.com/help/doc/user_ed.jsp?section=Customizing&target=customize_functions.htm%23HYPERLINK&loc=help

 

 

 

asish1989asish1989

Hi

   will you please make sure that you have two visual force page or one .It will better If you share your complete code and  describe your problem . There is no direct way to call popup form Hyperlink . But there must be some way . 

Share your code I will go through it tomorrow.

 

 

       Thanks

 

saiisaii

Hi asish1989

 

I Have Only one visualforcepage and i want open  that  page   has Pop up using hyperlink formula field .

thanks in advances

 

asish1989asish1989

Hi

  I think Its not possible in hyperlink. When you click on hyperlink formula filed It always open in a new window.so Its better to use command link or button for your requirement.

 

 

 

 

 

     Thanks 

saiisaii
thanks for ur reply .....i know using the command link
Supriya VSupriya V
Thank you Asish..!!! your code was very helpfull.