Monday, 28 July 2008

Snappy Calendar and Table components for ICEfaces


There are many dimensions to Ajax, yielding many different possible approaches. One particularly interesting dimension is the division of labour between client and server. Generally, ICEfaces assigns the most work to the server, treating the browser as a remote display. There are a number of reasons for this:

  • The data is on the server.
  • Server-side logic is not open to inspection by attackers.
  • MVC is preserved.
  • Only server-side events can trigger Ajax Push.
  • Java code is far easier to write and maintain: client-side code requires custom JavaScript.

So how do you implement a date picker? As a custom JSF component, of course. Clicking on an arrow to the right of "July" updates the page with a new calendar for "August", containing an <h:commanLink> for each day of the month. It can handle a wide range of locales and can account for varied daylight savings time legislation throughout history. But if we ignore the chaos introduced by daylight savings time, is this ultimately the right solution from a distributed computing point of view? Wouldn't it be more efficient to page through calendars in the browser, and only submit data to the server when the user had actually picked a date?

Of course, a client-side date picker is more efficient at runtime; the reasons that ICEfaces took a server-side approach with this particular component were because, at the time, we didn't want to write the JavaScript and we wanted to experiment with a component as complex as a date picker.

As an alternative, the Snappy Calendar is a purely client-side date picker for ICEfaces. You will also find a Snappy Table that provides a client-side table with sorting and row selection. There are two particularly interesting things about these components: one, that they are client-side implementations; and two, that they are developed outside ICEfaces.org. Please try them out and provide your comments directly to the author or on the ICEfaces forums.

Technorati Tags:

Posted by ted.goddard at 5:02 PM in Entries by Ted Goddard

« July »
SMTWTFS
  12345
6789101112
13141516171819
20212223242526
2728293031