This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes Google Chart inside a Primefaces p:dialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Google Chart inside a Primefaces p:dialog" Watch "Google Chart inside a Primefaces p:dialog" New topic
Author

Google Chart inside a Primefaces p:dialog

Mehdi Singer
Greenhorn

Joined: May 10, 2011
Posts: 4
Based on this blog entry I'm trying to display a Google Chart inside a Primefaces dialog box.

My xhtml file:


My backing bean:



My chart renderer:



With above code, when I press my button the dialog box shows up but is empty. The method `buildHistory` is called before the renderer but my chartModel is empty i.e. if I look at the source code, no row has been added to my chart. But in this particular case an empty chart should be displayed anyway.

If I add `ajax="false"` to my button, the dialog box doesn't show up at all but my chartModel is populated i.e. in the source code I see the code of my chart and if I copy paste the code of the chart into an HTML file it works...

Note also that if I don't put the chart inside the dialog box I get the expected result:



Am I missing something? Can someone give me a hint?

I'm running Glassfish 3.1.1, JSF 2.1, Primefaces 3.4, Mojarra 2.1.6

Thanks for your help !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Google Chart inside a Primefaces p:dialog