You need to sign in to do that
Don't have an account?
Beth G.
Apex and Visualforce Page- pop-up window notice to user-sample code
I am trying to create a Vforce page that will pop up a notice to the user, Is it possible to get some sample code for that?
The idea would be to popup a message to the user after they complete some require fields on a custom object.
After making all the changes and clicking the save button you add
<apex:CommandButton action="{!Save}" onClick="popupWindow();" value="Save" />
Write the Script in the visual force
<apex:page>
<apex:form>
<script>
popup(){
Window.open('/VFPage Name');
}
ok(){
Window.close();
}
</script>
<apex:CommandButton action="{!Save}" onClick="popupWindow();" value="Save" />
<apex:CommandButton action="{!ok}" onClick="popupWindow();" value="ok" /> // This and the script for ok to be on the popup page.
</apex:form>
</apex:page>
If this gives helps you make this as a solution.
see if this helps you out,
http://cloudforce4u.blogspot.in/2013/07/javascript-validation-in-visualforce.html
mark thisa s answer and hit kudos if it helped you.
Here's another approach - -using only VF and VF controller, no Javascript
http://www.tehnrd.com/visualforce-pop-up/
I am trying to create a popup window to appear to the user in the UI. So I created a a VF page for the popup window. Also I created another VF-page associate to the the custom object that I want the popup window to appear. However when I try to call the other VF-page it is not appearing ( see the popupcomannd VF-page). Why?
Also, I need the popup window to appear when the user enters 'Feature Request Name" (required field) on the custom object. What would the javascript be?
VF-page (labeled: popupcommand)
VF-page (labeled message) popup window code:
the controller is
Beth -- It looks like you are using tehNrd's solution
His solution, if you examine it carefully, uses a single VF page /apex/popup that contains a button 'show popup' that manipulates controller variables to make the outputpanel as popup visible/invisible.
Look at his demo here: http://tehnrd-developer-edition.na7.force.com/popup
I have a pagereference save() method that will save the page on this standard action in my visualforce page. Is possible to have my commandbutton triggering the "save" action and on he sametime to launch this popup window?
The save action is very simple: <apex:commandButton action="{!save}" value="Save Descriptions" id="saveDescription" />
And the code for this method is this:
public PageReference save(){
this.stanController.save();
return page;
}
I think that I can't add two actions to a commandbutton, but probably can modify the apex code?
Any help on this would be much appreciated.
Thanks.
Thanks for the code!