Issue with TabView and chart 3.0M4

UI Components for JSF
Post Reply
Raubvogel87
Posts: 12
Joined: 03 Nov 2011, 10:02

09 Nov 2011, 10:45

Hi,

it seems like there is a bug with charts in dynamic non-cached tab view. Reproduction example:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">

	<h:head>
	</h:head>

	<h:body>
		<h:form>
			<p:tabView dynamic="true" cache="false">
				<p:tab title="Test1">
					<p:lineChart id="myChart"
						value="#{myController.lineChartModel}"
						 />
				</p:tab>
				<p:tab title="Test2">
					Some content.
				</p:tab>
			</p:tabView>
		</h:form>
	</h:body>

</f:view>
</html>
and the managed bean:

Code: Select all

package de.volkswagen.ais.va.admin.ui;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import org.primefaces.model.chart.CartesianChartModel;
import org.primefaces.model.chart.ChartModel;
import org.primefaces.model.chart.LineChartSeries;

@ManagedBean
@RequestScoped
public class MyController {

	public ChartModel getLineChartModel() {
		CartesianChartModel model = new CartesianChartModel();
		
		model.addSeries(new LineChartSeries("my series"));
		model.getSeries().get(0).set(1, 10);
		model.getSeries().get(0).set(2, 15);
		
		return model;
	}
	
}
The problem is that switching between tabs does not show again the line chart component (although at first load the line chart is rendered correctly). Also tried with pie chart, same issue. Maybe something goes wrong with ajax update?

Please, try to reproduce the issue.

Steffen Harbich
PrimeFaces 3.0M4, MyFaces 2.1, Tomcat7

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 51 guests