HTML and CSS Reference
In-Depth Information
public String getMaxDate() {
return maxDate;
Using the Composite Component
With the backing bean in place we can access the minDate and maxDate properties containing the converted dates and
insert them in the implementation of the composite component.
Listing 7-17. Composite Component Using the Backing Bean and Accessing the Converted Values
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
" " >
<html xmlns=" "
xmlns:cc=" "
xmlns:jsf=" "
xmlns:h=" "
xmlns:f=" " >
<cc:interface componentType="inputDate" >
<cc:attribute name="value" type="java.util.Date" required="true" />
<cc:attribute name="list" type="java.lang.String" default="" />
<cc:attribute name="step" type="java.lang.String" default="1" />
<cc:attribute name="min" type="java.util.Date" />
<cc:attribute name="max" type="java.util.Date" />
<cc:attribute name="readonly" type="java.lang.String" default="false" />
<cc:attribute name="required" type="java.lang.String" default="false" />
<cc:clientBehavior name="change" targets="date" event="change" />
<div id="#{cc.clientId}">
<input jsf:id="date"
jsf:readonly="#{cc.attrs.readonly != 'false' ? 'true' : 'false'}"
jsf:required="#{cc.attrs.required != 'false' ? 'true' : 'false'}"
<f:convertDateTime pattern="yyyy-MM-dd" />
With the composite component and backing bean in place, we are ready to use the component. Listing 7-18
shows some examples with accompanying screenshots in Figure 7-5 .
Search WWH ::

Custom Search