{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
function insertScript(){
var box = new SimpleDialog("hersh"+Math.random(), true);
parent.box = box;
box.setTitle("Create new Order");
box.createDialog();
box.setWidth(350);
box.setContentInnerHTML("<apex:page standardController="Account"><h1>Congratulations</h1>This is your new Page<button class='btn' onclick='window.parent.box.hide(); return false;'>Cancel</button></apex:page>");
box.setupDefaultButtons();
box.show();
}
insertScript();
I simply need something like window.showModalDialog(<page_name>,"",<options>). here in the option I need to have overlay property where I can set opacity:0.5 like this...
I am pasting this function in the custom button itself with javascript as an option.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
function insertScript(){
var box = new SimpleDialog("hersh"+Math.random(), true);
parent.box = box;
box.setTitle("Create new Order");
box.createDialog();
box.setWidth(350);
box.setContentInnerHTML("<apex:page standardController="Account"><h1>Congratulations</h1>This is your new Page<button class='btn' onclick='window.parent.box.hide(); return false;'>Cancel</button></apex:page>");
box.setupDefaultButtons();
box.show();
}
insertScript();
I am able to open the popup but neither its getting close & nor refreshing the parent window. Could you please explain which code will go into the VF page.
it gives me error Error: Field startRequest does not exist. Check spelling.
My question is can I use a public method [startRequest] form the page controller [ContinuationSOAPController ] in the box.setContentInnerHTML() function.
objective achieved
All Answers
check out jquery dialog
www.jqueryui.com
Use following custom component
visualforce page
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
http://wiki.developerforce.com/page/Tutorial:_Modal_Dialogs_in_Visualforce_using_the_Yahoo!_User_Interface_Library
refer to the above link
Hi,
It is still leading the leading the url to a new page. I want it to comeout on the page layout itself rather navigating to other page.
What solution did you implement.... a bit of detail can help to resolve your issue.
Are you working on a satandard page or visualforce page?
I simply need something like window.showModalDialog(<page_name>,"",<options>). here in the option I need to have overlay property where I can set opacity:0.5 like this...
I am pasting this function in the custom button itself with javascript as an option.
Hi
I am working in standard 'page layout' with custom button in the top
Try this solution
http://boards.developerforce.com/t5/Visualforce-Development/Modal-popup-over-entire-standard-object-detail-page/td-p/232441
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
will work on this and let u guys know. thanks for the link btw
Hi,
I am trying the following code on the lines of the link..it is throwing some java script error:
objective achieved
Thanks for help guys ..specially Chamil :)
Now I need to know how to pass whole object not a object field into javascript of custom button.
Hello,
I just publish a post where I think everything related with modal dialogs on standard salesforce pages is well explained:
http://www.valnavjo.com/blog/modal-dialog-on-a-standard-salesforce-page/
I hope you find it useful!
JVN
I am able to open the popup but neither its getting close & nor refreshing the parent window. Could you please explain which code will go into the VF page.
Thanks,
Your post dated March 28, 2012 helped a lot. I still need to extend a functionality.
here is my code javascript code
function insertScript(){
var box = new SimpleDialog("test"+Math.random(), true);
parent.box = box;
box.setTitle("Submit Request Results");
box.createDialog();
box.setWidth(350);
box.setWidth(350);
box.setContentInnerHTML("<apex:page controller="ContinuationSOAPController ">
<apex:form>
<apex:commandButton value="Execute" action="{!startRequest}" reRender="result"/>
</apex:form>
<apex:outputText id="result" value="{!result}" />
</apex:page>");
box.show();
}
it gives me error
Error: Field startRequest does not exist. Check spelling.
My question is can I use a public method [startRequest] form the page controller [ContinuationSOAPController ] in the box.setContentInnerHTML() function.
Following code is for : "Calling Visualforce Page" from page layout --> Custom Button.