Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't Get Multiple Charts (Google Visualization) on Multiple Tabs (GWT TabPanel)
    primarykey
    data
    text
    <p>I need to display an unknown quantity of tabs each with an unknown quantity of graphs (Google Visualizations). I have created "Tab" and "Graph" classes and Tab contains an ArrayList.</p> <p>TabWrappers extends FlexTable and is currently empty. It's a place holder at the moment, but the behavior does not change if I use FlexTable rather than TabWrapper.</p> <p>The code below, minus the section that adds Tab2 works perfectly for creating 1 tab populated with graphs. When adding the 2nd tab both tabs are displayed and named correctly but neither have graphs.</p> <pre><code> public class SomeClass { ... DataTable data = response.getDataTable(); DataView result; Options options = createOptions(); ArrayList&lt;Tab&gt; displayTab = new ArrayList&lt;Tab&gt;(); Tab t; ArrayList&lt;Graph&gt; graphList = new ArrayList&lt;Graph&gt;(); Graph g; t = new Tab(); g = new Graph(); result = DataView.create(data); result.setRows(new int[]{0, 2, 4, 6}); g.setGraphType(new PieChart(result, options)); graphList.add(g); g = new Graph(); result = DataView.create(data); result.setRows(new int[]{1, 3, 5, 7}); g.setGraphType(new PieChart(result, options)); graphList.add(g); g = new Graph(); result = DataView.create(data); g.setGraphType(new PieChart(result, options)); graphList.add(g); t.setTabName("Tab1"); t.setGraphs(graphList); displayTab.add(t); // Add a 2nd tab t = new Tab(); t.setTabName("Tab2"); t.setGraphs(graphList); displayTab.add(t); TabWrapper tabWrapper; for (Tab tX : displayTab){ int row = 0, col = 0, maxCol = 2; tabWrapper = new TabWrapper(); for (Graph gX : tX.getGraphs()) { col = tX.getGraphs().indexOf(gX) - (row * maxCol); tabWrapper.setWidget(row, col, gX.getGraphType().asWidget()); if (++col == maxCol) { row++; } } tabPanel.add(tabWrapper, tX.getTabName()); } ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload