function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi All,
Is there any way to open a pop-up by web service or Apex class??
Hi,
This is possible. Try the following example,
VF page:
<apex:page controller="EgPOPupCon"> <!-- Popup styling starts here --> .......................... <!-- Popup to show while an opportunity is created ENDING--> <apex:pageblock > <apex:pageblockSection rendered="{!INPUT == true}"> <apex:inputtext value="{!name1}"/> <apex:commandbutton value="Save" action="{!showpop}" /> </apex:pageblockSection> <apex:pageblockSection rendered="{!INPUT == false}"> <apex:outputtext value="{!name1}"/> </apex:pageblockSection> </apex:pageblock> </apex:form></apex:page>
Apex Class:
public class EgPOPupCon{ public Opportunity opp{get;set;} public boolean INPUT{get;set;} public boolean pop{get;set;} public string name1{get;set;} public EgPOPupCon(){ INPUT = true; } public pageReference save(){ pop = false; input = false; opp = new Opportunity(name = name1, stagename = 'Prospecting', closedate = Date.today()); insert opp; PageReference nextpage1 = new PageReference('/apex/EgPOPup'); return nextpage1.setRedirect(true); } public void showpop(){ pop = true; } public void reject(){ pop = false; } }
You can modify the page and controller as you would like to do as per your requirement.
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.
Hi Kamatchi,
I have to open a page by apex class. This class is not associated with any VF.
Then try the following,
<apex:page > <apex:form > <apex:commandButton value="Open SecondVF" onclick="window.open('apex/SecondVF','popUpWindow','height=200,width=400,left=100,top=100');" /> </apex:form></apex:page>
SecondVF page:
<apex:page>
welcome this is simple popup window..!
</apex:page>
If we are running a class from Visualforce page like clicking on button or links, it becomes easier to open a pop-up. But I have to a method and opening a pop-up. This method will run by web service.
Thanks,
Hi,
This is possible. Try the following example,
VF page:
<apex:page controller="EgPOPupCon">
<!-- Popup styling starts here -->
..........................
<!-- Popup to show while an opportunity is created ENDING-->
<apex:pageblock >
<apex:pageblockSection rendered="{!INPUT == true}">
<apex:inputtext value="{!name1}"/>
<apex:commandbutton value="Save" action="{!showpop}" />
</apex:pageblockSection>
<apex:pageblockSection rendered="{!INPUT == false}">
<apex:outputtext value="{!name1}"/>
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
Apex Class:
public class EgPOPupCon{
public Opportunity opp{get;set;}
public boolean INPUT{get;set;}
public boolean pop{get;set;}
public string name1{get;set;}
public EgPOPupCon(){
INPUT = true;
}
public pageReference save(){
pop = false;
input = false;
opp = new Opportunity(name = name1, stagename = 'Prospecting', closedate = Date.today());
insert opp;
PageReference nextpage1 = new PageReference('/apex/EgPOPup');
return nextpage1.setRedirect(true);
}
public void showpop(){
pop = true;
}
public void reject(){
pop = false;
}
}
You can modify the page and controller as you would like to do as per your requirement.
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.
Hi Kamatchi,
I have to open a page by apex class. This class is not associated with any VF.
Hi,
Then try the following,
VF page:
<apex:page >
<apex:form >
<apex:commandButton value="Open SecondVF" onclick="window.open('apex/SecondVF','popUpWindow','height=200,width=400,left=100,top=100');" />
</apex:form>
</apex:page>
SecondVF page:
<apex:page>
welcome this is simple popup window..!
</apex:page>
You can modify the page and controller as you would like to do as per your requirement.
Hope so this helps you...!
Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.
Hi Kamatchi,
If we are running a class from Visualforce page like clicking on button or links, it becomes easier to open a pop-up. But I have to a method and opening a pop-up. This method will run by web service.
Thanks,