when loading a page with a pe:gChart my browser turns white and I get the following browser console error:

"Uncaught Error: The container #form:j_id_6c:chartForm:gChart is not defined."

After refreshing the page (F5) everything works fine, the chart is displayed correctly etc.


 <h:form id="chartForm" style="text-align: center;">
        <div id="gChartDiv">
            <pe:gChart value="#{data.testModel}" title="Test"
                rendered="#{!data.noDataYet}" id="gChart">

Already posted on primefaces forums here, but since the pfe and pf versions are set in ivy they couldn't really help.

Any idea on fixing this?


asked 06.04.2017 at 09:12

zenoo's gravatar image

accept rate: 0%

edited 06.04.2017 at 09:41

This sample works in Ivy: https://www.primefaces.org/showcase-ext/sections/gchart/basic.jsf;jsessionid=node0gzhije8myrwx1x5550c6oe8h0345257.node0

I did the following:


<pe:gChart value="#{data.chartModel}" title="How Much Pizza I Ate Last Night">

data model

chartModel > org.primefaces.extensions.component.gchart.model.GChartModel

Java class

package test;
import java.util.Random;
import org.primefaces.extensions.component.gchart.model.GChartModel;
import org.primefaces.extensions.component.gchart.model.GChartModelBuilder;
import org.primefaces.extensions.component.gchart.model.GChartType;

public class ChartModelCreator  {

    private Random random = new Random();  
    private int mushrooms = random.nextInt(10);  
    private int onions = random.nextInt(10);  
    private GChartModel chartModel = null;

    public ChartModelCreator() {  
        chartModel = new GChartModelBuilder()
                .addColumns("Topping", "Slices")
                .addRow("Mushrooms", mushrooms)  
                .addRow("Onions", onions)

    public GChartModel getChartModel(){  
        return chartModel;  


ivy logic Directly after start() make an ivy script step, which applys

import test.ChartModelCreator;
ChartModelCreator creator = new ChartModelCreator();
in.chartModel = creator.getChartModel();

How das your model look like? Which browser version do you use?


answered 06.04.2017 at 17:03

Alex%20Suter's gravatar image

Alex Suter ♦♦
accept rate: 84%

edited 06.04.2017 at 17:04

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 06.04.2017 at 09:12

Seen: 1,255 times

Last updated: 06.04.2017 at 17:04