Reputation: 319
i work on a project where we use JSF + Primefaces I would like to know if it's preferable to use JSF components as much as possible even if there are sometimes the same components in Primefaces (for basic use) Using Primefaces only for specific things not available on the JSF version
When should we use Primefaces instead of JSF ?
sorry for any faults
Upvotes: 0
Views: 846
Reputation: 2043
Better choose one of them and develop all application using mainly one stack. Will be easy to support, easy update, easy bug fix. Primefaces at the moment good choose.
Upvotes: 0
Reputation: 800
I think the most important point is consistency, which comes in a couple of flavours.
PrimeFaces (PF) components have a lot of styling put on them (through the theme options). If you use PF components throughout your application, you'll get a consistent style. If you mix PF and JSF components this will look messy.
PF components have a particular way of doing things - organising options, defining ajax calls etc. While it's important to know how the JSF stuff works underneath, using PF components consistently will make your code consistent too.
Finally, in many cases PF components are exact replacements for JSF components, but often with extra features added. There's no reason not to take advantage of them.
Upvotes: 3
Reputation: 524
In general, I'd say prefer them than JSF standard components, the reason is simple: CSS skinning. For example, even if h:inputText
and p:inputText
are exactly the same component, you might want to have the same CSS skinning for all JSF components (specially if you use a premium layout from PF)
But, I think there are few exceptions:
If you use JSF 2.3. For example, I'd rather use h:commandScript
than p:remoteCommand
. As they're not "visual" components, I'd prefer to use standard components. See also what works better for you ;-)
Also, Oleg presents some performance killer using PF components in datatable, see here http://ovaraksin.blogspot.com/2013/05/jsf-choice-between-legacy-components.html
Upvotes: 4