Page 1 of 1

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

Posted: 22 Sep 2011, 10:13
by vistek
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

Code: Select all

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

My facelet code is here:

Code: Select all

 <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.

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

Posted: 22 Sep 2011, 13:34
by cagatay.civici
You need to use a lazy chart and initialize on tab show. Similar to editor.

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

Posted: 22 Sep 2011, 16:33
by vistek
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