webtier@glassfish.java.net

Re: JSF 2.0: Ajax Section of JSF2 Tutorial Now Available

From: <webtier_at_javadesktop.org>
Date: Mon, 05 Oct 2009 15:46:13 PDT

There's a lot to comment on here.

First, I've got my own slides up on SlideShare:

http://www.slideshare.net/jimdriscoll/jsf-2-and-ajax

I meant to put a CreativeCommons on them - please feel free to use them, I'll update them with the appropriate license sometime soon.

Now, some comments:

onevent (and onerror) is for client side event handling - "side effects" isn't how I'd say it, though I suppose that's mostly true.

Flash is mostly used for video display. Most of the folks I've met who've tried to use it for non-media purposes would rather gouge their eyes out with a fork than do that again.

You don't have to choose between client side frameworks like jQuery or Dojo and JSF's Ajax libraries - they should work together, with the important exception of the Ajax calls.

for f:ajax event, you could use the term "DOM Event" instead of "JavaScript event". It's more accurate, I think, and less ambiguous.

for render and execute, be sure to cover the UIComponent.findComponent syntax for ID, and note how they're different than the rendered client side ID's. (For instance, prependId=false doesn't get rid of the prepended ID in the tree, only in the page). Yes, this is confusing, but you can get a lot of extra expressive power because of this. Your prependId example works, but not because of why you think it does :-(

onerror is much more important than onevent - for example, you could show handling a view expired exception gracefully... onevent has a more limited utility for things like busy status indicators (see my blog for an example).

Rather than using outputText to dynamically generate tags, the new Composite Component feature is probably more friendly to that use case. And yes, it should work with Ajax too, if you write it correctly.


Lastly, you may wish to dive into resources, and the jsf.ajax.request function. But that will make the slidedeck much longer.

Jim
[Message sent by forum member 'driscoll' (jim.driscoll_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=366906