Java Reference
In-Depth Information
<h:commandButton id="book"
value="#{_seat.booked ? 'Not
Available' : 'Book'}"/>
<h:outputText value="Booked seats on this page:
#{bookingRecord.bookedCount}" id="bookedCounter" />
We have highlighted the core enhancements added to this page. At first, as we said, we
need to reference the RichFaces libraries at the top of the XHTML page.
Next, we added a rich Ajax component, a4j:poll , which does a simple but an effective job
of polling the server for updates, allowing the re-rendering of our components— grid
(which contains the main datatable), poller (to check whether it should still be run-
ning), and bookedCounter .
Additionally, this component references a CDI bean named Poller , which acts just as
an on/off flag for our poller. We expect to turn off polling as soon as all the seats are sold
package com.packtpub.wflydevelopment.chapter4.controller;
import java.util.Optional;
import javax.enterprise.inject.Model;
import javax.inject.Inject;
Search WWH ::

Custom Search