January 2013
Intermediate to advanced
328 pages
7h 14m
English
PrimeFaces' chart components support the itemSelect AJAX behavior event, which is fired when an item on the plotted data is clicked upon.
A simple definition for a bar chart, with a listener attached and two series of data to be displayed, is given as follows:
<p:barChart id="withAjax" value="#{barChartController.model}" style="height:250px">
<p:ajax event="itemSelect" listener="#{barChartController.itemSelect}" update="growl" />
</p:barChart>The listener is defined with the p:ajax component and will be called with the org.primefaces.event.ItemSelectEvent attribute.
public void itemSelect(ItemSelectEvent event) { MessageUtil.addInfoMessageWithoutKey("Item selected", "Series Index:" + event.getSeriesIndex() ...Read now
Unlock full access