Java Reference
In-Depth Information
</f:view>
</ui:define>
</ui:composition>
We have highlighted the core enhancements added in this page. At first, as we said,
we need to reference the RichFaces libraries at the top of the XHTML page.
Next, we have added a rich Ajax component, a4j:poll , which does a simple but an
effective job of polling the server for updates, allowing re-rendering of just one com-
ponent—the grid component—which contains the main datatable.
Additionally, this component references a JSF managed bean named PollerBean ,
which acts just as an on/off flag for our poller. We expect to turn off polling as soon
as all seats are sold out:
package
com.packtpub.as7development.chapter4.service;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class PollerBean implements Serializable{
boolean pollingActive=true;
public boolean isPollingActive() {
return pollingActive;
}
public void setPollingActive(boolean
pollingActive) {
this.pollingActive = pollingActive;
}
}
Search WWH ::




Custom Search