• Post Reply Bookmark Topic Watch Topic
  • New Topic

passing values from jsf to popup  RSS feed

 
Teena Malkani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a JSF which contains 1 link ..on clicking that link...popup window should open and some values which are present on main jsf need to be sent to popup window.

Please suggest me the way for that.

thanks in advance
 
Srinivas Krishnamoorthy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a normal JSF forward method to transfer data to the page bean of the pop-up page and return the mapping forward to the pop-up page (Till this point the code should be a complete one to open the page in the same window)

to open the popup use javascript function given below. Call the function in the onmousedown method of the link, popUpScreen('viewbase',this).

The first parameter is just a unique string.

function popUpScreen(targetScreenName,hyperlinkObject) {
newwindow = window.open('',targetScreenName, "height=450,width=650");
if (window.focus) {newwindow.focus()}
document.forms[0].target = targetScreenName;
hyperlinkObject.onclick();
document.forms[0].target = "";
}
 
Venkat Sadasivam
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To pass values to popup screen you have to follow the traditional way of sending through query string as part of the url.

You can use FacesContext.getRequestParamMap().get("RequestKey"); to fetch the query string value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!