You need to sign in to do that
Don't have an account?
Nag86
Session is not maintained between two visual force pages
Hi all,
Urgent help required!!!!
We have a requirement of opening a popup onselecting a checkbox.
Iam able to open a visual force page from a visual force page after selecting check box.
Both VF Pages are defined with extensions as same controller.
When the pop up opens, the values in the controller are reset to null.
How do i maintain session in between these two pages and use the values in the controller in the second page also.
Thanks in Advance
Nag
Hi All,
The problem of YUI popup with IE7 + is resolved........
We need to enable some security settings like cross domain script, Allow Scriptlets, Active scripting..etc etc, once we enabled all valid of these, YUI popup is working fine.
All Answers
opening a new window will cause a new request, not a partial page request. So, it is not possible to share a controller context.
You can pass query string parameters to the popup, but passing info back is not so easy.
I recomend a different type of popup, called a floating div or hidden div that is modal.
This is actually the same page, so page session/context is shared and user input info is available (in the controller) after the div is hidden again.
Simple examples are found here:
http://www.javascripttoolbox.com/lib/popup/example.php
There is a larger example of this method on the following site:
http://particletree.com/features/lightbox-gone-wild/
i believe YUI also has such a modal DIV that you could use to get the same result.
I don't have a visualforce sample of this yet, so if you do build one please post back your code!
Ok, i found a good example of this on javascripttoolbox.com
lots of good libraries there.
here is the Visualforce version of a modal dialog
<apex:page controller="varController"> <!-- read : http://www.javascripttoolbox.com/lib/popup/example.php download JS from: http://www.javascripttoolbox.com/libsource.php/popup/combined/popup.js --> <apex:includeScript value="{!$Resource.popup}" /> <apex:form id="theform"> <apex:outputPanel id="modal" style="border:1px solid black; width:250px; display:none;"> <apex:pageBlock > This is a modal popup!<br /> Enter your new value here, click Done. <apex:inputText value="{!inputVar}" /> <apex:commandButton value=" Done " onClick="Popup.hide('{!$Component.modal}')" rerender="result" /> </apex:pageBlock> </apex:outputPanel> <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton onclick="Popup.showModal('{!$Component.modal}');return false;" value="Show Modal Popup" /> <apex:commandButton onclick="Popup.showModal('{!$Component.modal}',null,null,{'screenColor':'#999999','screenOpacity':.6});return false;" value="Show Modal Popup With A Custom Screen"></apex:commandButton> </apex:pageBlockButtons> <apex:outputPanel id="result"> <h2><apex:outputText value="{!inputVar}" /></h2> <br /> </apex:outputPanel> </apex:pageBlock> </apex:form> </apex:page>
and the controller:
public class varController { public string inputVar { get; set; } }
You can download the library JS and store this in a static resource.
The library i used is here :
http://www.javascripttoolbox.com/libsource.php/popup/combined/popup.js
Hi Ron,
Thanks for a quick response.
Iam stuck up with some issue. I am landing up with some java scrpipt errors like "GenericSfdcPage" undefined, "Sidebar" undefined.
Do i need to do some additional settings for the code to work.?
that's strange.
my entire page is just as posted. did you try a simple page like this?
Yes Ron.
I have tried the sample posted above.
Iam getting the javascript erros. Not sure about the issue.
In urgent need of help. We have a demo with client tommorrow.
Ron,
I have tried tehsame code using mozilla.Its working fine.
May be i need to change the setting in my IE.
but how can i expect my client to change the settings....can there be any work around.??
Here is an article on how to build this popup using YUI, thanks to Dave Carroll ( devAngel) for the code!
http://wiki.apexdevnet.com/index.php/Visualforce_Popup
Visualforce Popup
I tried this example and is not working in IE, only Mozilla. Also, the recent posted example http://wiki.apexdevnet.com/index.php/Visualforce_Popup that uses the YAHOO library works only in this browser. It seems both libraries use some assumptions that are only valid in Mozilla browser.
More than that I removed the use of varController (display only a text and "Done" button in modal dialog), associate the page with standardController="Account" and insert it in Account page layout. The popup is "cut" by next subSection (in Mozilla, in IE doesn't work at all).
From the investigation I made so far the "cut" window behaviour seems to be a security cross domain issue.
I'm very interested to know if there is any solution to embedd an apex:page in a standard object page and to be able to open "any" window on top of any other existing windows (at least my parent page window).
Thanks in advance.
Hiiii,
I have just used the YAHOO modal popup with the IE 7 as suggested , it still gives error "YAHOO is undefined",
Not sure abt th issue, I need urgent help on this, please please suggest if any..........
Below is url for screnshot of the javascript error I am getting on IE
http://picasaweb.google.co.in/akshay.subscribe/YUI?feat=directlink#slideshow/5493005009522062930
Many Thanks,
Akshay
Hi All,
The problem of YUI popup with IE7 + is resolved........
We need to enable some security settings like cross domain script, Allow Scriptlets, Active scripting..etc etc, once we enabled all valid of these, YUI popup is working fine.