Board index JavaServer Faces General there is a problem using p:tabView and p:chart together

there is a problem using p:tabView and p:chart together

Components, Ajax Framework, Utilities and More.


Posts: 19
Hi Guys,

I am in trouble with charts on a p:dialog with p:tabView. When i use a chart in p:tabView on a p:dialog, First tab chart is rendered but others are not rendered.

When i look the html code with firebug. I can see all html code for rendered chart on the first tab, however i only see below simple div for others

<div style="height: 150px; width: 500px; position: relative;" id="j_idt212:j_idt216" class="jqplot-target"></div>



My facelet code is here:
 <p:dialog id="odGroupPanel" header="dialog header"
   widgetVar="odGroupDialog" modal="true" width="600" minWidth="600">
   <p:tabView>
      <p:tab title="tab 1">
            <p:lineChart rendered="#{revenueSettingBean.panelData.tabDataList[0].chart ne null}"
               value="#{revenueSettingBean.panelData.tabDataList[0].chart}"
               legendPosition="e"  minY="0" style="height:150px; width:500px"/>
      </p:tab>
      <p:tab title="tab 2">
            <p:lineChart rendered="#{revenueSettingBean.panelData.tabDataList[1].chart ne null}"
               value="#{revenueSettingBean.panelData.tabDataList[1].chart}"
               legendPosition="e"  minY="0" style="height:150px; width:500px"/>
      </p:tab>
   </p:tabView>
</p:dialog>


Volkan.
Mojarra 2.0.3.FCS
Glassfish v.3.1.2 / JBoss 7.1.0
Primeface 3.4


Posts: 14916
Location: Cybertron

You need to use a lazy chart and initialize on tab show. Similar to editor.
PrimeFaces Lead


Posts: 19
First of all thanks for your reply. I did not find layz propoerty for charts in 3.0.RC1-SNAPSHOT. I have tried to use remoteCommand according to following yigit.darcin post. However it is not work.

viewtopic.php?f=3&t=6949

Please add a simple lazy chart example.

Volkan
Mojarra 2.0.3.FCS
Glassfish v.3.1.2 / JBoss 7.1.0
Primeface 3.4


Return to General