Data model event
FacesContext facesContext = FacesContext.getCurrentInstance();
dataTable = (HtmlDataTable)facesContext.getApplication().createComponent(
HtmlDataTable.COMPONENT_TYPE);
DataModel myDataModel = new ResultSetDataModel(myResultSet);
myDataModel.addDataModelListener(new DataModelListener()
{
public void rowSelected(DataModelEvent e)
{
FacesContext.getCurrentInstance().getExternalContext().
log("row selected:" + e.getRowIndex());
}
});
dataTable.setValue(myDataModel);
Phase event
lifecycle.addPhaseListener(
new PhaseListener()
{
public void beforePhase(PhaseEvent event)
{
priceQuote = QuoteService.getLatestQuote(currentQuoteId);
}
public void afterPhase(PhaseEvent event)
{
}
public PhaseId getPhaseId()
{
return PhaseId.RENDER_RESPONSE;
}
});