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

marți, 13 octombrie 2015

JSF 2.0-2.3 Progress of Iterable/Map support in UIData/UIRepeat (OmniFaces support via utility functions)

Related to this topic must read:

Iterating in UIData (e.g. <h:dataTable>)
JSF 2.0/2.1
- supports the List, native array and JSF specific DataModel as input for its value binding
- for Iterable (e.g. Queue, Set) you can use the OmniFaces function, of:iterableToList().
- for Set only (especially useful to Hibernate/JPA users, who are usually using the Set collections for entity relationships)
  you can use the OmniFaces function, of:setToList().
- if EL 2.2 is available, for Iterable, you can use toArray() (e.g. #{fooBean.fooIterable.toArray()}).
- for Map you can use the OmniFaces function, of:mapToList().
- if EL 2.2 is available, for Map, you can use toArray() (e.g. #{fooBean.fooMap.entrySet().toArray()} or #{fooBean.fooMap.keySet().toArray()}
  or #{fooBean.fooMap.values().toArray()}).

JSF 2.2                                                                                          
- supports the List, native array and JSF specific DataModel as input for its value binding
- you can use directly the Iterable (e.g. Set, Queue)
- for Map you can use the OmniFaces function, of:mapToList().
- since Iterable is directly supported, you can use  it as #{fooBean.fooMap.entrySet()} or #{fooBean.fooMap.keySet()}or #{fooBean.fooMap.values()}

JSF 2.3                                                                                          
- supports the List, native array and JSF specific DataModel as input for its value binding
- you can use directly the Iterable (e.g. Set, Queue)
- you can use Map directly

<h:dataTable value="#{fooBean.fooMap}" var="t">
 #{t.key} #{t.value}
</h:dataTable>

You can see a complete demo here (it was tested with Mojarra 2.3.0 Milestone 4 under Payara 4.1.

Iterating in UIRepeat (e.g. <ui:repeat>)
JSF 2.0/2.1/2.2
- supports the List, native array and JSF specific DataModel as input for its value binding
- for Iterable (e.g. Queue, Set) you can use the OmniFaces function, of:iterableToList().
- for Set only (especially useful to Hibernate/JPA users, who are usually using the Set collections for entity relationships)
  you can use the OmniFaces function, of:setToList().
- if EL 2.2 is available, for Iterable, you can use toArray() (e.g. #{fooBean.fooIterable.toArray()}).
- for Map you can use the OmniFaces function, of:mapToList().
- if EL 2.2 is available, for Map, you can use toArray() (e.g. #{fooBean.fooMap.entrySet().toArray()} or #{fooBean.fooMap.keySet().toArray()}
  or #{fooBean.fooMap.values().toArray()}).

JSF 2.3                                                                                          
- supports the List, native array and JSF specific DataModel as input for its value binding
- you can use directly the Iterable (e.g. Set, Queue)

<ui:repeat value="#{fooBean.fooSet}" var="t">
 ...
</ui:repeat>

- you can use Map directly

<ui:repeat value="#{fooBean.fooMap}" var="t">
 #{t.key} #{t.value}
</ui:repeat>

You can see a complete demo here (it was tested with Mojarra 2.3.0 Milestone 4 under Payara 4.1.

Niciun comentariu :

Trimiteți un comentariu

JSF BOOKS COLLECTION

Postări populare

OmniFaces/JSF Fans

Visitors Starting 4 September 2015

Locations of Site Visitors