• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

f:facet funtionality

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the funtionality of <f:facet> ? I am not able to understand it.

I have seen some code as <blockquote>code:
<pre name="code" class="core"><f:facet name="header"/> <f:facet name="expand"/></pre>
</blockquote>

Does the "header" and "expand" have any special meaning?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<h:dataTable>
<h:column>
<f:facet name="header">
<h:outpuText value="bhaskar"/>
</f:facet>

Here value bhaskar will dispaly in header of the table.
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bhaskar,

So I guess name="header" has a significance.

Is there any link which provides all possible combinations that can be entered as name attribute of facet ?
 
Bhaskar GR
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry man
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joshua,

the name part of facet can be anything. For example if you are writing a tree component, when you instantiate each Node, you pass in a string. For a node name, like if you were writing a tree component to represent a file system, you would have 2 different kinds of nodes, namely, directory, and file. So to show each Node differently you use the facet tag. <h:facet name="dir"... and <h:facet name="file"...

Have a look at some tree examples if this doesn't make sense, hopefully the examples do.
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Darryl,

I tried changing the name attribute of f:facet in the datatable and it did not work.

After some googling I found the below link:

http://www.jsftoolbox.com/documentation/help/12-TagReference/core/f_facet.html

So, perhaps it depends where f:facet are declared, as you rightly pointed out if it is used by tree nodes then the name does not matter but when used inside column may be it matters.


I also found the below code from a site

<blockquote>code:
<pre name="code" class="core">
<t:tree2 id="clientTree" value="#{treeBacker.treeData}" var="node" varNodeToggler="t">
<f:facet name="foo-folder">
<h:panelGroup>
<f:facet name="expand">
<t:graphicImage value="images/yellow-folder-open.png" rendered="#{t.nodeExpanded}" border="0"/>
</f:facet>
<f:facet name="collapse">
<t:graphicImage value="images/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}" border="0"/>
</f:facet>
<h:outputText value="#{node.description}" styleClass="nodeFolder"/>
<h:outputText value=" (#{node.childCount})" styleClass="childCount" rendered="#{!empty node.children}"/>
</h:panelGroup>
</f:facet>
</t:tree2>
</pre>
</blockquote>


In the above case appropriate images are loaded depending on whether tree is expanded or collapsed, hence my guess is that "expand" and "collapse" are some reserve words while using facet inside tree.

Please let me know if I have misunderstood anything.

Regards,
Joshua
 
Joshua Antony
Ranch Hand
Posts: 254
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the link posted in previous post:

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 of the component associated with the h:dataTable tag.

Regards,
Joshua
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic