F: facet

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.