Skip to main content

jMaki & GWT TabPanel

3 replies [Last post]
Joined: 2008-05-14

Greetings, I am new to jMaki and GWT. I successfully implemented a jMaki example but notice that if I add the chart to a tab that is not the one initially selected I get an exception. Is this by design or am I doing something incorrectly? Thx

public class TestHarnessMainPanel
extends VerticalPanel {

public TestHarnessMainPanel() {
TabPanel tp = new TabPanel();
HorizontalPanel hp = new HorizontalPanel();

String[] labels = {"May", "June", "July", "August"};

// A pie chart only has 1 axis
Axes axes = new Axes(new Axis(labels));

// create an instance of the piechart
final PieChart pc = new PieChart(400, 400, axes, PieChart.GREEN);

double[] points = {250, 35, 435, 15};
DataSet ds = new DataSet("prices", "Some prices", points);

tp.add(hp, new HTML("Charting Example"));
tp.add(new Label("Content for second tab"), new HTML("Another Tab"));

// this works

// this does not work


Exception thrown when using option 2

Error loading jmaki.widgets.jmaki.charting.pie.Widget : id=jmaki_chart_0
Script: http://localhost/TestHarness/com.ghx.testharness.TestHarness/TestHarness... (line: 158).
Message: Invalid argument.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2008-05-14

It seems it works if I hold off on drawing the chart until the tab is selected as noted with the onTabSelected() method. Once drawn I can switch back and forth to other tabs but the initial drawing of the chart has to be done only on a tab that is currently selected.

Joined: 2005-02-10

Which toolkit are you using? Some of the toolkits will only render if the container where the widget goes is visible at page load. Lazyload set to true will force the widget to load when that container is made visible. This is expected behavior.


Joined: 2008-05-02


I have the same problem with a triggered displayed window which contains my chart. I obtain the same error.

What is this LazyLoading option ? Where can i handle it ? I don't find it in JavaDoc from jMaki or GWT-Ext which is the toolkit that i use for my window.

Thanks for your answer.