dev@javaserverfaces.java.net

Re: Seeking Review jsfri-63: back button and commandLink

From: Adam Winer <adam.winer_at_oracle.com>
Date: Fri, 22 Oct 2004 13:33:22 -0700

Jacob Hookom wrote:

> One thing I could suggest in for areas where we generate Javascript, if
> the attribute already has a value, prepend our script to the existing
> value. I'm not sure if the renderkits already works that way?
>
> onClick="alert('Developer debugging');"
>
> becomes
>
> onClick="injectedScript(); alert('Developer debugging');"
>
> -Jacob

The tricky thing is making sure that you preserve semantics
of their callback, especially w.r.t to the return value.
This commandButton case is actually fairly straightforward here;
prepending this script would work fine. But commandLink
would be trickier, since you'd really want to prepend the *user's*
script, and only call the built-in onclick if the user's
script does not return false. This takes some fancy footwork
in Javascript.

-- Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net