My JSF Books/Videos My JSF Tutorials OmniFaces/JSF PPTs
JSF 2.3 Tutorial
JSF Caching Tutorial
JSF Navigation Tutorial
JSF Scopes Tutorial
JSF Page Author Beginner's Guide
OmniFaces 2.3 Tutorial Examples
OmniFaces 2.2 Tutorial Examples
JSF Events Tutorial
OmniFaces Callbacks Usages
JSF State Tutorial
JSF and Design Patterns
JSF 2.3 New Features (2.3-m04)
Introduction to OmniFaces
25+ Reasons to use OmniFaces in JSF
OmniFaces Validators
OmniFaces Converters
JSF Design Patterns
Mastering OmniFaces
Reusable and less-verbose JSF code

My JSF Resources ...

Java EE Guardian
Member of JCG Program
Member MVB DZone
Blog curated on ZEEF
OmniFaces is an utility library for JSF, including PrimeFaces, RichFaces, ICEfaces ...

[OmniFaces Utilities] - Find the right JSF OmniFaces 2 utilities methods/functions

Search on blog

Petition by Java EE Guardians

Twitter

duminică, 15 martie 2015

[OmniFaces utilities (2.0)] Get the metadata attributes


[OmniFaces utilities] The getMetadataAttributes(String viewId) method returns the metadata attribute map of the given view ID, or an empty map if there is no view metadata.
[OmniFaces utilities] The getMetadataAttributes() method returns the metadata attribute map of the current view, or an empty map if there is no view metadata.
[OmniFaces utilities] The getMetadataAttribute(String viewId, String name) method returns the metadata attribute of the given view ID associated with the given name.
[OmniFaces utilities] The getMetadataAttribute(String name) method returns the metadata attribute of the current view associated with the given name.

Method Faces#getMetadataAttributes(String viewId) - returns the metadata attribute map of the given view ID, or an empty map if there is no view metadata:
See also: Faces#getContext()

Method Faces#getMetadataAttributes() - returns the metadata attribute map of the current view, or an empty map if there is no view metadata:
See also: Faces#getContext()

Method Faces#getMetadataAttribute(String viewId, String name) - returns the metadata attribute of the given view ID associated with the given name:
See also: Faces#getContext()

Method Faces#getMetadataAttribute(String name) - returns the metadata attribute of the current view associated with the given name:
See also: Faces#getContext()
Usage:

·         invoke Faces#getMetadataAttributes(String viewId):

// returns the metadata attribute map of the 'index.xhtml' view
import org.omnifaces.util.Faces;
Map<String,Object> metattr = Faces.getMetadataAttributes("index.xhtml");

or,

// returns the metadata attribute map of the 'index.xhtml' view
import static org.omnifaces.util.Faces.getMetadataAttributes;
Map<String,Object> metattr = getMetadataAttributes("index.xhtml");

·         invoke Faces#getMetadataAttributes():

// returns the metadata attribute map of the current view
import org.omnifaces.util.Faces;
Map<String,Object> metattr = Faces.getMetadataAttributes();

or,

// returns the metadata attribute map of the current view
import static org.omnifaces.util.Faces.getMetadataAttributes;
Map<String,Object> metattr = getMetadataAttributes();

·         invoke Faces#getMetadataAttribute(String viewId, String name):

// returns the metadata attribute of the 'index.xhtml' view associated with 'myname' name
import org.omnifaces.util.Faces;
String attr = Faces.getMetadataAttribute("index.xhtml", "myname");

or,

// returns the metadata attribute of the 'index.xhtml' view associated with 'myname' name
import static org.omnifaces.util.Faces.getMetadataAttribute;
String attr = Faces.getMetadataAttribute("index.xhtml", "myname");

·         invoke Faces#getMetadataAttribute(String name):

// returns the metadata attribute of the current view associated with 'myname' name
import org.omnifaces.util.Faces;
String attr = Faces.getMetadataAttribute("myname");

or,

// returns the metadata attribute of the current view associated with 'myname' name
name
import static org.omnifaces.util.Faces.getMetadataAttribute;
String attr = Faces.getMetadataAttribute("myname");

Niciun comentariu :

Trimiteți un comentariu

JSF BOOKS COLLECTION

Postări populare

OmniFaces/JSF Fans

Follow by Email

Visitors Starting 4 September 2015

Locations of Site Visitors