Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

popup

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic