p:pieChart does not work inside of p:tab

UI Components for JSF
Post Reply
Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

16 Oct 2011, 21:59

I created a composite component that looks like this:

Code: Select all

   <cc:implementation>

        <p:panel rendered="!#{cc.tallyOk}">
            <h:outputText value="ERROR: Tally Doesn't Exist" />
        </p:panel>

        <p:panel rendered="#{cc.tallyOk}">

                <h:outputText value="Whar's the Pie?  Whar?" />

                <p:pieChart 
                    seriesColors="FF0000, FF66FF, FFCCFF, CCFFCC, 66FF66, 009900"
                    value="#{cc.model}"
                    style="width:#{cc.attrs.width}px;height:#{cc.attrs.height}px" 
                    />

        </p:panel>

    </cc:implementation>
Now I use the component like this:

Code: Select all

                          
                        <qc:tallyPie value="#{frontPage.topTenActiveAllTime.get(0)}" height="400" width="400" />
                        <hr/>
                
                <p:tabView dynamic="true" cache="true">

                    <p:tab title="Top Tallies">

                        <qc:tallyPie value="#{frontPage.topTenActiveAllTime.get(0)}" height="400" width="400" />

   ... etc
                        
The first reference to the component works perfectly. According to Firebug it renders a div element containing a bunch of canvas elements. The second reference renders everything except the actual chart. Where the chart is supposed to be I get a div element with nothing inside it. I think the plotting functions are not getting the right client ID of the div element in the case where the p:pieChart is inside a tabView. Can anyone advise how to fix this?

This is on 3.0.M3.

P.S. It also does the same thing with p:dataGrid.
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

User avatar
daniel_r
Posts: 199
Joined: 02 Mar 2009, 16:35

16 Oct 2011, 22:27

Sorry haven't noticed that my suggested solution was already in use...

oooops....
Last edited by daniel_r on 16 Oct 2011, 23:11, edited 1 time in total.
Primefaces 3.4 , MyFaces 2.0.11
Tomcat 6
Win7 32bit


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: jaircalistrato and 51 guests