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
apexuserapexuser 

How show popup page on custom button click(The custom button is at opportunity related list level)

Hi Folks,

             My requirement is like this:

I need to show a visual source page as popup page on click of a custom button and the button is at opportunity related list level.Can any one tell me how to achive this and  with any code examples.

 

Thanks.

b-Forceb-Force

yap,

It is possible using some JQuery Stuff,

see the link how it looks.

 

you need to configure JQuery at Orglevel and then you can use JQuery modal call to open the pop-up

 

Let me know your interset so I can help you

 

Thanks ,

Bala

vhanson222vhanson222

Unless the page that the related list appears on is a VF page, you may have some trouble getting that to work.

 

Here is a great article on getting JQuery modal dialog boxes on Visualforce pages.

 

Using jQueryUI to make popups in Visualforce pages

 

Hope that helps

Pradeep_NavatarPradeep_Navatar

Find below a sample code :

 

<script type="text/javascript">
function popup(oid)
{
var url='/apex/ma4?id=' + oid;   
window.open(url,"Homepage","resizable=yes,status=yes,scrollbars=yes,width=400,height=200,target=_blank");
}
</script>
<apex:outputText value="Opportunity Details:" style="font-size:13px;color:#00FFFF;font-weight: bold"/>
<apex:pageBlock >
<apex:outputPanel id="opnlOpp">
<apex:pageBlockTable value="{!propLstWO}" var="o">
<apex:column value="{!o.propName}">
<apex:facet name="header">Opportunity Name</apex:facet>
</apex:column>
<apex:column value="{!o.propAmount}">
<apex:facet name="header">Opportunity Amount</apex:facet>
</apex:column>
<apex:column value="{!o.propAttachNames}">
<apex:facet name="header">Opportunity Attachments</apex:facet>
</apex:column>
<apex:column ><input type="button" value="upload" onclick="popup('{!o.propId}')"/>
<apex:facet name="header">Browse</apex:facet>
</apex:column>
</apex:pageBlockTable>
</apex:outputPanel>
</apex:pageBlock>    
</apex:outputPanel>

In controller you can retrieve the {!o.propId} through wrapper class and bind with the popup visual force page.

sundarayya edasundarayya eda
Hi,

To display another visualforce page as a popup fallow bellow steps if it is a related button
EX: opportunity is parent and contract is a child
1. create a button in contract buttons and links, select link button behaviour is exicute javascript and 
Content Source is on clickjava script
write link like this window.open('/apex/PageName?Param1='+'{! Opportunity.Id }','mywindow','width=600,height=200');
2. write a vf page Pagename.
Add that button to the opportunity related list contracts
1.edit the opportunity layout and go to related list contract
2.press rench and in buttons section move the button to selected buttons section. save and open any opportunity record
go to contract related section you will find the button which you added. press it