[OmniFaces utilities] The fireEvent() fires the given CDI event, optionally with the given qualifiers.Method:See also: Beans#getManager()Usages:In Java EE the observers are marked with… Read More
As you probably know, JSF supports dedicated tags for loading resources, such as<h:outputStylesheet> for CSS resources, <h:outputScript> for JavaScript resources and <h:graphi… Read More
A mistake is to not associate/interpret correctly the JSF lifecycle phases with the listen events types; you have to know which events takes place in which JSF phase. Per example, the below… Read More
As you probably know, PrimeFaces support Bean Validation. Actually, PrimeFaces comes with a client side validation framework integrated with Bean Validation Specification. Basically, P… Read More
As you probably know, PrimeFaces comes with a very useful support for client side validation based on JSF validation API and Bean Validation. In this post we will focus on Bean Validation, a… Read More
As you probably know, PrimeFaces comes with a component capable to display data with a circular animation. This component is named Ring.For example, the below snippet of code will work… Read More
[OmniFaces utilities] The isActive() returns true when the given CDI managed bean scope is active. I.e., all beans therein can be accessed without facing ContextNotActiveException.Method:Usa… Read More
Consider the following custom tag structure:<my:tag id="foo" name="fooName"> The id, <strong>#{id}</strong>, belongs to, <strong>#{name}</strong> <… Read More
The <f:attribute/> sets the specified name and attribute on the parent UIComponent. If the "value" specified is not a literal, it will instead set the ValueExpression&n… Read More
OmniFaces provides a component capable to catch the output from a JSP or Servlet resource and render it as output to the JSF writer. For example, let's suppose that we have the followi… Read More
The JSF custom scope allows us to implement our own scopesWhen none of the JSF/CDI/OmniFaces/DeltaSpike scopes meet your application needs, you may want to pay attention to the JSF 2 custom… Read More
[OmniFaces utilities] The getObject() returns the typed Object value of the given tag attribute.Method:See also: Facelets#getString()|getBoolean()|getObject()Usage:Suppose that we have… Read More
[OmniFaces utilities] The isAjaxRequestWithPartialRendering() returns whether the current request is an ajax request with partial rendering. That is, when it's an ajax request without render… Read More
[OmniFaces utilities] The formatThousands() formats the given number to nearest 10n (rounded to thousands), immediately suffixed (without space) with metric unit (k, M, G, T, P or E), roundi… Read More
Let's suppose that we have a rating system based on PrimeFaces Ratingcomponent. Basically, we have three rating components that allows to the user to express his opinion about the main shots… Read More
[OmniFaces utilities] The getViewName() returns the base name of the current view, without extension, or null if there is no view. E.g. if the view ID is /path/to/some.xhtml, then this will… Read More
[OmniFaces utilities] The formatThousandsUnit() formats the given number to nearest 10n (rounded to thousands), suffixed with a space, the metric unit prefix (k, M, G, T, P or E) and the giv… Read More
I've just updated the "PrimeFaces & OmniFaces Powers Combined" with the following new sections and chapters:Chapter 2 (update section)Use <p:commandButton/Link/> and <o:param/&g… Read More
[OmniFaces utilities] The sendFile() sends a file to the response whose content is provided via given output stream callback. The content type will be determined based on file name. The cont… Read More
The <f:convertNumber/> convert a String to a number of required format (it also acts as a validator to ensure the input value is a valid number)Common/basic usage in JSF (I)… Read More
The Java EE Security API (JSR 375) is moving forward, as summarised by Arjan Tijms here: http://arjan-tijms.omnifaces.org/p/whats-new-in-java-ee-security-api-10.html. One thing to note… Read More
Check also:The three golden rules of useJSF Navigation Tutorial - Declarative NavigationJSF VS Series: Implicit Navigation VS Declarative (explicit) NavigationImplicit navigation is availabl… Read More
[OmniFaces utilities] The getStateHelper() method exposes protected state helper into public.Method:See also: Reflection#findMethod()Usage:import org.omnifaces.util.Hacks;...StateHelper… Read More
IntroductionIn order to understand what a render kit is we have to be aware of some major notions that are very important in this context. For a better understanding please check out the bel… Read More
[OmniFaces utilities] The parseLocale() method parses the given object representing the locale to a Locale object. If it is null, then return null. Else if it is already an instance of Local… Read More
[OmniFaces utilities] The formatNumberDefaultForLocale() method formats the given number in the default pattern of the given locale. This is useful when you want to format numbers in for exa… Read More
The OmniFaces <o:validateMultiple/> allows the developer to validate multiple fields by either a custom validator method or, by a managed bean instance which implements the&n… Read More
[OmniFaces utilities] The removeViewState() method remove server side JSF view state associated with current request.MethodSee also: Faces#getSessionAttribute()Moreover, see also the pr… Read More
[OmniFaces utilities] The getRemoteAddr() method returns the Internet Protocol (IP) address of the client that sent the request. This will first check the X-Forwarded-For request header and… Read More
Starting with OmniFaces 2.3 we can take advantage of a brand new feature - register a web socket push connection in client side. Thanks to the OmniFaces team this feature is availa… Read More
OmniFaces 2.3 comes with a new tag handler named SkipValidators. As its name suggest, this tag handler allows us to entirely skip validation when executing an UICommandor ClientBehaviorHolde… Read More
[OmniFaces utilities] The load() method loads the given script resource on complete of the current ajax response. Basically, it loads the script resource as String and then delegates it to #… Read More
[OmniFaces utilities] The encodeURI() method encodes the given string using UTF-8. URIs (paths and filenames) have different encoding rules as compared to URLs. URLEncoder is actually only f… Read More
PrimeFaces supports cache at rendering time. Basically, at initial request, PrimeFaces will cache the HTML markup that corresponds to the content delimited by <p:cache/>tag. This means… Read More
Recommended to read before: Caching via PrimeFaces and EHCache (register MBeans in JConsole via OmniFaces @Eager)PrimeFaces supports two different providers of cache implementation: EHCache… Read More
This is a simple post about writing a stateless JSF application for holding a dummy shopping cart using Hazelcast. The application uses PrimeFaces, OmniFaces and it is deployed on Payara Ser… Read More
When an error occurs in a Java program it usually results in an exception being thrown. Java exception handling enables Java applications to handle errors and this is an important aspect in… Read More
Sometimes, it may be useful to encapsulate the AJAX requests in JavaScript functions placed in the JavaScript global scope in such way that we can simply call them by name, without arguments… Read More
[OmniFaces utilities] The isSerializable() method returns true if the given object is serializable.Method:Usage:Example 1 - test Object:import org.omnifaces.util.Utils;...Utils.isSerial… Read More
Let's checkout a common practice for declaring constants in Java using the public static final declaration:public class Circle { private static final float PI = 3.14f; private stat… Read More
[OmniFaces utilities] The reverseArray() function returns a copy of the array with items in reversed order.Function:Usage:Let's suppose that we have the following simple array defined in a b… Read More
[OmniFaces utilities] The getCurrentActionSource() method returns the source of the currently invoked action, or null if there is none, which may happen when the current request is not a pos… Read More
[OmniFaces utilities] The getActionExpressionsAndListeners() method returns a list of all action expressions and listeners associated with given component. This covers expressions in action… Read More
[OmniFaces utilities] The getRequestURI() method returns the HTTP request URI, regardless of any forward or error dispatch. This is the part after the domain in the request URL, including th… Read More
[OmniFaces utilities] The getRequestQueryString() method returns the HTTP request query string, regardless of any forward.Method:Use this one outside JSF context(Servlets#getRequestQueryStri… Read More
[OmniFaces utilities] The getParams() returns an unmodifiable map with all request query string or view parameters, appended with all child UIParameter components () of the given parent comp… Read More
[OmniFaces utilities] The formatThousandsUnit() formats the given number to nearest 10n (rounded to thousands), suffixed with a space, the metric unit prefix (k, M, G, T, P or E) and the giv… Read More
[OmniFaces utilities] The formatThousands() formats the given number to nearest 10n (rounded to thousands), immediately suffixed (without space) with metric unit (k, M, G, T, P or E), roundi… Read More
1. Introduction
Omnifaces is a library of components for JSF2 that arise from the proposed solutions to common problems on JSF2,
exposed in the well-known Stack Overflow ;&nbs… Read More