Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

composite:renderFacet vs composite:insertFacet  RSS feed

 
Ranch Hand
Posts: 1709
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, what is the difference between composite:renderFacet and composite:insertFacet? I am not very clear even though there is an explanation in stackoverflow.
Let me use an example of Chapter 9 from Core JSF book:

I changed the composite:renderFacet into composite:insertFacet
//login.xhtml

//index.xhtml

If we use renderFacet for the login composite, the heading is displayed.
If use use insertFacet for the login composite, the heading is not displayed.
What is the difference between renderFacet and insertFacet?
renderFacet.JPG
[Thumbnail for renderFacet.JPG]
When renderFacet is used, the heading "Please log in" is displayed.
insertFacet.JPG
[Thumbnail for insertFacet.JPG]
When insertFacet is used, the heading is not displayed.
 
Himai Minh
Ranch Hand
Posts: 1709
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more example I tried is to add a data table to the composite component from the book:


//Index.xhtml that uses the composite login
renderTableCaption.JPG
[Thumbnail for renderTableCaption.JPG]
When the data table has a renderFacet, the caption is not rendered
insertTableCaption.JPG
[Thumbnail for insertTableCaption.JPG]
When data table has insertFacet, the caption is inserted
 
Himai Minh
Ranch Hand
Posts: 1709
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding to my previous posts


I think a form cannot have a f:facet. That is why the heading facet is not displaying.
See this post from stackoverflow: https://stackoverflow.com/questions/24937757/ffacet-not-working-with-hform
 
Bartender
Posts: 20107
101
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A composite is basically a custom control, and while I've been unable to do as much as I'd like with them thanks to working with obsolete applications, I think that they're mostly used where you define the custom control in a separate XML file.

And no, forms don't have facets. Facets generally define parameters to a JSF-unique control (such as a dataTable or panelGrid) and commonly are used where an element can have multiple child facets. The "h" namespace for JSF maps legacy HTML controls and HTML controls don't have facet-like behavior.
 
Let's get him boys! We'll make him read this tiny ad!
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!