Skip to content

Instantly share code, notes, and snippets.

@testforti
Created May 23, 2013 11:24
Show Gist options
  • Save testforti/5635393 to your computer and use it in GitHub Desktop.
Save testforti/5635393 to your computer and use it in GitHub Desktop.
<p:tabView>
<p:ajax event="tabChange" listener="#{bean.onTabChange}" />
<p:tab title="Tab 1" id="tab1">
//chart1
</p:tab>
<p:tab title="Tab 2" id="tab2">
//chart2
</p:tab>
<p:tab title="Tab 3" id="tab3">
//chart3
</p:tab>
</p:tabView>
function renderTheChart(tabIndex) {
var categories= [];
var categories= [];
<ui:repeat var="data" value="#{bean.dataList}">
categories[categories.length] = "#{data.id}";
values[values.length] = #{data.value};
</ui:repeat>
renderChart(values, categories, tabIndex);
}
PP
Hacking
PSOE
BBVA
Santader
<p:tabView onTabChange="handleTabChange(event, index)">
function handleTabChange(event, index) {
renderTheChart(index);
}
RequestContext context = RequestContext.getCurrentInstance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment