I am using PrimeFaces JSF library and the following code to open a page in the popup dialog:
<p:commandLink ajax="false" onclick="PopupMultiFileSelect('multi_file_select.faces', 'Select files','500','300'); return false;">
<h:graphicImage style="border: none" value="./img/add.jpg"/>
</p:commandLink>
Here is the javascript code:
function PopupMultiFileSelect(pageURL, title, w, h)
{
var left = (screen.width/2)-(w/2);
var top = (screen.height/2)-(h/2);
var childWin = window.open (pageURL, '_blank', 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
if ( childWin.opener==null )
childWin.opener = self;
return childWin;
}
What I do in the popup page is just select some filenames and place the names inside a string List, like so:
List<String> fileNames;
How would I pass the List down to the caller page?
You can use f:param to pass information to another page.
See this example :