• Post Reply Bookmark Topic Watch Topic
  • New Topic

popup

 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to get a popup window on a button click. Eventhough the window is opened, am getting nullponter exception on that wondow.
Here is my code :


popup jsp :


Please help me to solve this issue.

Thanks,
Joe.
 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I solved the issue. It was AddDescription.jsf instead of .jsp

Thanks,
Joe.
 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Now am getting the window. But I need to pass parameters from parent window to the child. I see example to passing parameters. But How can I get the passed parameter in the child window ? Can I get the passed parameter value in the child jsp bean ?

Thanks,
Joe.
[ February 09, 2007: Message edited by: Joe Jose ]
 
rajani varma
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Joe,

In the parent window,
use the <f:param> to pass the parameter. For eg,



and in the child Bean, get the parameter by using the name attribute of <f:param>. for eg.

public String someAction(){
String result = null;
Map parameters = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String value = (String) parameters.get("activityAction");
this.setActivityName(value);
if(value == null || value.length() == 0){
throw new IllegalArgumentException("Could not find parameter 'activityAction' in request parameters");
}else{
result = ......
}
return result;
}

public String getActivityName() {
return activityName;
}

public void setActivityName(String activityName) {
this.activityName = activityName;
}

And in the child window jsp, get the value from the child bean.

I think this is what you want. Hope this helps....

-Rajani.
 
rajani varma
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,

In my case, I have a set of commandLinks with different values. when I click on each of the commandlink, the value of the commandLink is passed as parameter, and I am getting its value from the backing Bean and displaying it in the next page.

This is what you are looking for???

-Rajani
 
Joe Jose
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rajani,

Thank you very much for both replies. Yes, I have a list box and when I select items from the list, I have to display that items in the popup window . And also I have to get values inserted in the popup window into the parent window. I think your first solution will do. Now I can test these only on Monday. I will let you know the result.

Thanks Rajani.
Joe.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!