webtier@glassfish.java.net

JSF 2.0: Errors or Ambiguity in Spec for "onevent" JavaScript Callback

From: <webtier_at_javadesktop.org>
Date: Tue, 29 Sep 2009 14:48:37 PDT

IMHO, section 14.4.1 of JSF_20090506.pdf is unclear.

1) Table 14-4 refers to responseTxt, but in my Mojarra build (Mojarra 2.0.0 SNAPSHOT 20090924), it is responseT[b]e[/b]xt. Since responseT[b]e[/b]xt is the property in the standard XMLHttpRequest, I presume that was what was intended, and Table 14-4 is in error.

2) It is not clear to me from reading the spec that it is the "status" property that should be "begin", "success", or "complete". Those three conditions are described clearly, but to me it is far from obvious from the spec that it is the status property that should contain this information. I confirmed it with Firebug, but I don't see it in the spec. I would think "status" should be one of the entries in the left column of Table 14-4. For example:

function oneventhandler(data) {
    if ([b]data.status[/b] == "begin") {
      showSomeAnimatedGifSayingImWorking();
    } else if ([b]data.status[/b] == "success") {
      hideSomeAnimatedGifSayingImWorking();
    }
}

3) Table 14-4 says that there should be a name property that refers to the callback handler's name, but it was not present in my implementation. It is not exactly obvious to me why this property would be useful, but nevertheless, Table 14-4 says it should be there, and it isn't.

4) I would reorder Table 14-3 so that the entries are in chronological order (begin, complete, success).

Cheers-

- Marty
http://www.coreservlets.com
[Message sent by forum member 'martyhall' (hall_at_coreservlets.com)]

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