Jim Driscoll

Subscribe to Jim Driscoll: eMailAlertsEmail Alerts
Get Jim Driscoll: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Top Stories by Jim Driscoll

Today we're going to talk about two features of JSF 2.0's f:ajax tag: the event attribute and the listener attribute. The use of both of these is really, really simple - so I'll just briefly cover the basics, and then launch directly into the sample code. The "event" attribute of the ajax tag indicates which event to use to trigger the ajax request. There are any number of possible events allowed: You can use the standard browser DOM events (like click, change, keyup, etc. You can also use two special event values - action and valueChange. These two special values correspond to the same events that happen on the server side in JSF. On the client side, action is typically mapped to click, while valueChange is mapped to change or click, depending on the component. The "listener" attribute of an ajax tag is a method that is called on the server side every time the ajax ... (more)

Inline Scripts with Mojarra

A few weeks ago, I blogged about ways to execute scripts on the client which you were writing out from the server via Ajax.  By popular demand, the latest build of Mojarra now allows execution of inline scripts. So, instead of having to either bundle code into an tag, or using an event to execute it later, you can now simply say something like: right inside the rendered html. You can also say something like: