Java Server faces 2.0, the complete referenceF: facet is explained as follows:
The F: facet tag signifies a nested component that has a special relationship to its enclosing
Tag. For example, stating that the "Header" of a table is to be provided by a JSF component.
This element adds the component represented by the JSF action in its body as a facet
The specified name to the component represented by the closest JSF component parent
Action element. This tag only allows one component to be nested within itself. To use
Multiple components as a facet, create them as children of a simple container component.
For example, nest the corresponding HTML library component actions within the body
A panelgroup component.
F: facet indicates a "nested component". This component has a specific relationship with the tags that contain it .... (<F: facet> nested component </F: facet> can contain only one "nested component" at a time ")
JsftoolboxThe website explains this as follows:
The facet tag registers a named facet on the component associated with
Enclosing tag. A facet represents a named section within a container component.
For example, you can create a header and a footer Facet for a datatable
Component.
Similar to the above.
The following example shows the usage of F: facet:
<H: datatable id = "reporttable" value = "# {reportbean. dailyreport} "Var =" item "> <br/> <p: column> <br/> <F: facet name =" Header "> <br/> <p: outputtext value = "Daily Report"/> <br/> </F: facet> <br/> <p: outputtext value = "# {item}"/> <br/> </p: column> <br/> </p: datatable> <br/>
The question is, since name = "*****" represents the relationship between facet and its components, can this relationship be written by yourself? Can I write "nested components" at will?
Rewrite the above Code:
<H: datatable id = "reporttable" value = "# {reportbean. dailyreport} "Var =" item "> <br/> <p: column> <br/> <F: facet name =" Header "> <br/> <p: inputtext value = "Daily Report"/> <br/> </F: facet> <br/> <F: facet name = "relation"> <br/> <p: outputtext value = "Daily Report"/> <br/> </F: facet> <br/> <p: outputtext value = "# {item}"/> <br/> </p: column> <br/> </p: datatable> <br/>
The operation found that the header is no longer a text, but an input box,
<F: facet name = "relation">
<H: outputtext value = "Daily Report"/>
</F: facet> NO output.
Conclusion:
The name attribute sets the name of the facet to be created. Some Components
Have facets with predefined names, such as the "Header" and "footer" facets
The component associated with the H: datatable tag.
Only facet with names pre-defined by components can be accepted. For example, H: datatable pre-defined facet with names "Header" and "footer. <F: facet> the content between tag pairs can be any component.