Even though it's considered bad practice, it's often handy to eval code in
JavaScript. And in my case, it was simply necessary, since the JSF
specification requires eval of scripts. And it's also necessary to execute
those evaluated scripts in the global scope. It's not as easy as it first
looks.
For our first naive implementation, we'd simply used eval(src) in our first
pass at the implementation.
This is utterly wrong, and to understand why, you'll need to understand
scopes. JavaScript has what you can think of as two different scopes -
function scope, where you're executing something in the context of a
function, and global scope, where you're executing something in a global
context - for instance, if I say var j = 1; within a function's scope, then
the variable j is set to 1 within that function. If I say the same
expression, var j = 1 within the global scop... (more)
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 t... (more)
Mojarra just went Beta, and the JSF spec just passed the JCP vote. If you
haven't looked at JSF in a while, it's time to take another look.
... (more)
In talking with Andy Schwartz before our recent talk together at Oracle Open
World, Andy mentioned that he'd like to see some new components make it in to
JSF 2.1.
I'd like to see that too - but what new components? To aid the discussion, I
thought it might be handy to make up a list of components that I think would
be handy for JSF - but please, don't take this as an endorsement of any
particular component for inclusion into the spec. At best, I can see us
adding only a handful, perhaps 3 or so. Still, once started, this kind of
project becomes it's own end - so I decided it mi... (more)
Another new feature of JSF 2.0 is integrated Ajax support. Here's one fairly
simple example of that feature in action.
... (more)