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
bhanu_prakashbhanu_prakash 

display popup with options

Hi Team,

Need to display popup with contains account and contact button ..  If i click on contact need to display list of contacts with pagination .
if i click on accounts need to display list of accounts with pagination
need to support both lightning and classic.

Thanks for advance
Best Answer chosen by bhanu_prakash
Gaurish Gopal GoelGaurish Gopal Goel
Hi Bhanu,

Its good to see that you have tried something. You are very close to the solution, you actually don't need apex to redirect. It can be done directly by JavaScript, please see the below code and change in your VF page accordingly and you can delete the controller methods in which you are redirecting.

If this answer solves your problem then mark it as the solution to help others. Thanks.
<!--###### MODAL BOX BODY Part Start From Here ######-->
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4"  type="Boolean">
                    <input type="radio" name="comradio" value="true" onclick="window.open('/apex/Display_list_of_accounts');"> Account </input>
				</div>
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4">
                    <input type="radio" name="comradio" value="true" onclick="window.open('/apex/Display_Opp_pagination');"> Oppournity </input>               
				</div>
			</div>

 

All Answers

Gaurish Gopal GoelGaurish Gopal Goel
Hi Bhanu,

Have you tried something by yourself yet or you have just posted the requirement? Its a humble request that you should only use this community to get answers for your queries.

If you have already done/tried something and getting stuck somewhere then I can surely help you. Thanks.
bhanu_prakashbhanu_prakash
Hi,

Page
<apex:page controller="Autopopup" lightningStylesheets="true">
<apex:slds />    
    <style>
        .slds-scope .slds-input{
            width: 50%;
        }
    </style>
    <apex:form >
      <div role="dialog" tabindex="-1" aria-labelledby="header99" class="slds-modal slds-fade-in-open ">
        <div class="slds-modal__container">
          <!-- ###### MODAL BOX HEADER Part Start From Here ######-->
          <div class="slds-modal__header">
            <button class="slds-button slds-modal__close slds-button--icon-inverse" title="Close" onclick="{}">
            X
            <span class="slds-assistive-text">Close</span>
            </button>
            <h2 id="header99" class="slds-text-heading--medium">Select Object</h2>
            </div>
            <!--###### MODAL BOX BODY Part Start From Here ######-->
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4"  type="Boolean">
                    <input type="radio" name="comradio" value="true" onclick="doMigacc"> Account </input>
            </div>
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4">
                    <input type="radio" name="comradio" value="true" onclick="dotransfer"> Oppournity </input>               
            </div>
          </div>
        <!--    
          <div class="slds-modal__footer">
            <button class="slds-button slds-button--neutral" onclick="{!}" >Next</button>            
          </div>     -->
      </div>
     </div>
      <div class="slds-backdrop slds-backdrop--open">
      </div> 
        
    </apex:form>
    <apex:outputPanel >  

    </apex:outputPanel>
</apex:page>

controller
 
public class Autopopup {    
  
    public void displayPopUp(){}
    public boolean displayPopup {get; set;}      
    public void closePopup() {        
        displayPopup = false;    
    }     
    public void showPopup() {        
        displayPopup = true;    
    }    
    
        public PageReference doMigacc(){      
        system.debug('test');
        PageReference pr = new PageReference('/apex/Display_list_of_accounts');
        pr.setRedirect(true);
        return pr;
    }
    
        public PageReference dotransfer(){      
        system.debug('test');
        PageReference pr = new PageReference('/apex/Display_Opp_pagination');
        pr.setRedirect(true);
        return pr;
    }
  }

User-added image

Need to redirect after click on account or oppournity stuck over here

Thanks for advance
Gaurish Gopal GoelGaurish Gopal Goel
Hi Bhanu,

Its good to see that you have tried something. You are very close to the solution, you actually don't need apex to redirect. It can be done directly by JavaScript, please see the below code and change in your VF page accordingly and you can delete the controller methods in which you are redirecting.

If this answer solves your problem then mark it as the solution to help others. Thanks.
<!--###### MODAL BOX BODY Part Start From Here ######-->
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4"  type="Boolean">
                    <input type="radio" name="comradio" value="true" onclick="window.open('/apex/Display_list_of_accounts');"> Account </input>
				</div>
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-horizontal--small slds-size--1-of-4">
                    <input type="radio" name="comradio" value="true" onclick="window.open('/apex/Display_Opp_pagination');"> Oppournity </input>               
				</div>
			</div>

 
This was selected as the best answer
bhanu_prakashbhanu_prakash
Thanks bro for fast replay