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
MitchellbMitchellb 

Accidently creating two panes after creating new page

The following code launches the new page inside the same window:

 

public

withsharingclass ContractingOpportunities {

public String Value2Pass { get; set; }

public PageReference generateContract() {

        PageReference newPage = page.ContractCreation;

        newPage.getParameters().put(

'MyVariable', Value2Pass);

       

return newPage;

    }

   

public String message { get; set; }

 

DisplayOpportunities[] opportunities;

publicclass DisplayOpportunities {

    

publicOpportunity opportunity { get; set; }

    

public Decimal count { get; set; }

    

public DisplayOpportunities(Opportunity item) {

       

this.opportunity = item;

    }

}

public

DisplayOpportunities[] getOpportunities() {     if (opportunities == null) {

         opportunities =

new DisplayOpportunities[]{};

        

for (Opportunity item :

                                [

SELECTName, Contract_Type__c, OrderNumber__c, TrackingNumber__c, CurrentGenerators__c                             

                                

FROMOpportunity

                                 ORDER

BY Contract_Type__c DESC

                                 ]) {       opportunities.add(

new DisplayOpportunities(item));       }     }

    

return opportunities;      }

}

 

Suggestions on how to make the newPage launch cleanly?

Bhawani SharmaBhawani Sharma
Are you using this page as inline VF page?
MitchellbMitchellb

The snippet above is the controller for a VF page.