Java Reference
In-Depth Information
Binding a Component Value to an Implicit Object
One external data source that a value attribute can refer to is an implicit object.
The bookreceipt.xhtml page of the Duke's Bookstore case study has a reference to
an implicit object:
Click here to view code image
<h:outputFormat title="thanks"
value="#{bundle.ThankYouParam}">
<f:param value="#{sessionScope.name}"/>
</h:outputFormat>
This tag gets the name of the customer from the session scope and inserts it into the para-
meterized message at the key ThankYouParam from the resource bundle. For example,
if the name of the customer is Gwen Canigetit, this tag will render:
Thank you, Gwen Canigetit, for purchasing your books from us.
Retrieving values from other implicit objects is done in a similar way to the example
shown in this section. Table 6-4 lists the implicit objects to which a value attribute can
refer. All of the implicit objects, except for the scope objects, are read-only and therefore
should not be used as a value for a UIInput component.
Search WWH ::




Custom Search