Tag Archives: primefaces

What’s New in PrimeFaces 5.1?

After two consecutive major, quite revolutionary releases it’s time for consolidation. Çağatay Çivici and his team seem to think the same and call the new release of PrimeFaces a minor version (5.1). It’s not that small, by the way: I’ve counted 660 commits, Granted, many commits deal with the new showcase, some deal with PrimeUI, but what remains is still impressive. According to the PrimeFaces blog the new version brings 225 filed improvements and more than 140 bug fixes.

So what’s new in PrimeFaces 5.1?
Continue reading

JSF 2.2 and PrimeFaces 5 on Spring Boot

Fork me on GitHubRecently I reported about Spring Boot (see Application Servers are dead! (Sort of)), an interesting approach to embed your application server into your application instead doing it the other way round.

However, Spring Boot is a fairly new technology, so the documentation is still work in progress. Most of the documentation is great, but there are still sentences like

Applications that are not already Spring applications might be convertible to a Spring Boot application, and the guidance above might help, but your mileage may vary.

Most JSF applications clearly fall into this category. So I’ve prepared a JSF template project to spare you some of the mileage. Currently there’s a simple simple PrimeFaces project and a more advanced project demonstrating Spring and JSF scopes.

To make things more interesting, I added Gradle and JSF custom scopes to the equation.
Continue reading

Useful PrimeFaces DataTable Events

I always used to skip over page 167 of the PrimeFaces 5 manual. That’s too bad: it’s an exciting page. It’s a list of the events a <p:dataTable> can fire. That’s no less than 19 interesting events.

Quick reminder: what are JSF events?

Chances are you already know the concept of JSF events from the <f:metadata> section of your JSF applications. Strictly speaking, the core JSF events I’l describe next belong to a different family than the events fired by the data table. They’ve got a different API. But still, both concepts are similar enough to mention them in the same article.

A standard JSF event, preRenderView, is frequently used together with view parameters. Doing so, your parameterized JSF page can be stored as a bookmark in the browser, much like Amazon allows you to simply copy the link of the book review you’re currently reading and send it to your friends:

  <f:metadata>
        <f:viewParam name="keyword" value="#{catalogController.keyword}"/>
        <f:event type="preRenderView" listener="#{catalogController.doSearch}"/>
  </f:metadata>

Continue reading

PrimeFaces Selector Framework: Use jQuery in JSF Expressions

These days I re-discovered a really cool PrimeFaces feature. It’s one of those features that raise JSF to another level. I’m talking about the PrimeFaces Selector API which allows you to use arbitrary jQuery expression instead of ideas.

For instance, this feature comes in handy with BabbageFaces, my JSF plugin that allows and even encourages you to do AJAX without IDs. In most cases it suffices to update the @form. However, when I started to port the Pet Store demo application written by Antonio Goncalves to AJAX and BabbageFaces, I discovered the language selector. Switching from – say – English to French requires you to update every text on the screen, no matter whether it’s inside or outside a form.
Continue reading

PrimeFaces 4.0 (and 5.0+) Client Side Validation

The next release of PrimeFaces, 4.0, is just a couple of days away. It’s time to have a look at the new features. Apart from JSF 2.2 support the most exciting new feature is client side validation. Now your application doesn’t have to drain the server’s resources to do simple tasks such a checking the field length. Your application is going to be more responsive while reducing the server cost and even reducing the carbon footprint of your application.
Continue reading

Primefaces RemoteCommand: Lazy Loading Revisited

Regular readers of this blog may remember last year’s article on how to utilize Primefaces poll component to implement lazy loading. The solution I proposed at the time suffered from a couple of minor itches. Today I looked at the task again and learned you can do a lot better. <prime:remoteCommand> is simpler and faster. And in contrast to <prime:poll> it’s dedicated to tasks like this.
Continue reading