Jul 05

PrimeFaces in Java EE6 with NetBeans 7

David Heffelfinger has released his new book titled “Java EE with NetBeans 7″. Importance of this book other that being a great resource on Java EE 6 for us is the wide coverage of PrimeFaces. As you know NetBeans 7 only bundles PrimeFaces as the component suite and David showed how to utilize PrimeFaces to create awesome looking RIA easily.

Lately an interview with David is posted on dzone where he also praises PrimeFaces.

And now it’s the time for me to order the hard copy of the book for my library.

Posted in Developer, Java, PrimeFaces | 1 Comment
Jul 04

PrimeFaces 3.0.M2 Unleashed

Prime Teknoloji is pleased to announce the 3.0.M2 version of the leading JSF component suite, PrimeFaces. This release contains more than 100 improvements and a lot of hard work. Notable features are;

  • Reimplementation of component event callbacks (*Listener, *Update) as ajax behaviors. See details here.
  • Reimplemented Charts using HTML5 Canvas, replaced flash based implementation.
  • Reimplemented Layout Component.
  • Reimplemented ColorPicker.
  • Resizable DataTable Columns.
  • Implementation of some most votes requests like default sorting for datatable.
  • Update to latest jQuery stack versions(jQuery, jQuery UI, jQuery Mobile …)
  • Fixes on security exploits
  • Bug Fixes
  • Bug Fixes
  • More Bug Fixes
See full list of changelog for detailed information and downloads section at PrimeFaces homepage to get the release.
Roadmap
Next iteration is 3.0.M3, it will contain tag/attribute documentation for IDE code completion, improvements over PrimeFaces Mobile and lots of maintenance. We’ve applied for a special funds here in Turkey to develop PrimeFaces Push so depending on the outcome fate of PF Push will be decided. M3 is due mid august followed by 3.0.RC1 in september and then the 3.0. final.
Posted in Developer, Java, PrimeFaces | 11 Comments
Jun 29

Tag/Attribute Docs back in 3.0.M3

If you haven’t heard already, PrimeFaces Guide will be free in 3.0 final, I’ll start updating it before 3.0 goes final which is planned for september. We’ve seen that there are many users on 3.0.x which is officially undocumented, only available doc resource is labs showcase. So to help a bit more, in 3.0.M3 we are putting the tag and attribute documentation back in facelet taglib so your IDEs can display what that attribute is for, what are the supported ajax behavior events of the component and more.

Also regarding 3.0 roadmap it is more clear for us now. There will be M2 hopefully next week followed by M3 in august and RC1 in september followed by 3.0 final.

Posted in Developer, Java, PrimeFaces | 10 Comments
Jun 10

DataTable Hooks

Most notable thing about PrimeFaces 3.0.M2 is the implementation of component callbacks as ajax behaviors, read more here about the idea here.

While providing the component events as behaviors, I have decided to add more hooks to increase flexibility even more. Frameworks like JSF and the component libraries tend to do a lot for you but important design principle of PrimeFaces is transparency and keep page author in control. As an application developer, I don’t like the feeling that I’m not the one in control when using frameworks.

One example is datatable, we have built-in paging, sorting, filtering but what if you want to execute custom javascript before and after paging, what if you want to update other components on page or execute a cusom java method during pagination? Here is how it can be done;

<p:datatable paginator="true" rows="10" value="#{bean.items}" var="item">
   <p:ajax event="page" listener="#{bean.onPaginate}" update="othercomponents" oncomplete="alert('done')"... />
   ...

Note that you don’t have to define page ajax behavior just to do regular pagination, it is only needed if you need to hook-in, otherwise default pagination will take place.

The new ajax behaviors bring great flexibility to PrimeFaces, in our forum I see that many of the limitations people are facing can easily be solved using our new approach.

Next generation of PrimeFaces is faster, smaller, more secure and much more flexible.

Posted in Developer, Java, PrimeFaces | 5 Comments
May 26

PrimeFaces-Spring Code Generation

SkySoftware, creator of MyEclipse for Spring Tool has put a screencast on Video demonstrating PrimeFaces-Spring code generation from database schemas. Great work! Tool is awesome, feedback I can give is to update PrimeFaces version and use p:* form components and allow an option in wizard to select the theme to use.

[youtube=http://www.youtube.com/watch?v=IeZ8pjRdCdE]

Also friends at SpringSource contacted me to provide an update on JSF-PrimeFaces addon for Spring ROO. Can’t reveal much other than “stay tuned” a bit more. :)

https://jira.springsource.org/browse/ROO-516

Posted in Developer, Java, PrimeFaces | 17 Comments
May 25

Executing Javascript from Server Side

As of PrimeFaces 2.x, oncomplete callback can be used to execute javascript when an ajax request completes like;


&lt;p:commandButton value=&quot;Submit&quot; oncomplete=&quot;alert('done')&quot; /&gt;

&lt;p:ajax oncomplete=&quot;alert('done')&quot; /&gt;

In case where you need to add conditional logic to your oncomplete that is done via RequestContext callback parameters, like hiding/showing dialog in case of validation errors(see demo).

With 3.0.M2, there is a new handy feature coming which is executing javascript from your backing beans;


RequestContext context = RequestContext.getCurrentInstance();

context.execute(&quot;alert('hi')&quot;);

context.execute(&quot;mydialog.hide()&quot;);
Posted in Developer, Java, PrimeFaces | 7 Comments
May 23

How to Stop Polling From Server Side

PrimeFaces Poll component enables doing periodic requests in a specified interval, at some point you may need to stop the polling depending on a change on server side. With PrimeFaces 2.2.1 this can be implemented using RequestContext API as;

&lt;p:poll listener=&quot;#{bean.listener}&quot; update=&quot;sth&quot; oncomplete=&quot;handlePollComplete(xhr, status, args)&quot; widgetVar=&quot;mypoll&quot; /&gt;
function handlePollComplete(xhr, status, args) {
    if(args.stopPolling) {
        mypoll.stop();
    }
}
public void listener() {
    if(condition) {
        RequestContext.getCurrentInstance().addCallbackParam(&quot;stopPolling&quot;, true);
    }
}

A bit of work right? Definitely against “make it easy” aim of PrimeFaces, so as of 3.0.M2 we can now do;

&lt;p:poll listener=&quot;#{bean.listener}&quot; update=&quot;sth&quot;  stop=&quot;#{bean.stop}&quot;/&gt;
private boolean stop = false;

public void listener() {
    if(condition) {
        stop = true;
    }
}

And that’s it, PrimeFaces will handle stopping the poll under the hood.

Posted in Developer, Java, PrimeFaces | 3 Comments