0
votes

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

3

3 Answers

3
votes

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:

3
votes

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.

0
votes

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.