New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors or Ambiguity in Spec for "onevent" JavaScript Callback #642
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented Include deprecation text on element. https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=744
Section 10.3.2. Correct xref to point to section in appendix that
To ease migration for Facelet taglibraries declared using pre-JSF 2.0 Use of this DTD is officially deprecated. This DTD is included for https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=588
insert around text for h:link and h:button https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=639
change "name" to "type" on description of f:event tag https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=509
Declare that the old, incorrect, Facelets decaration of the uri for https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=673
Clarify what should happen if the target attribute is not specified. https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=642
table 14.4.1, change responseTxt to responseText reorder rows in table 14.3 make use case for event listeners be correct. https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=635
3.5.3, 3.5.6.1: remove references to UInput.encodeEnd(). Not for a https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=740
|
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
IMHO, section 14.4.1 of JSF_20090506.pdf is unclear.
Table 14-4 refers to responseTxt, but in my Mojarra build (Mojarra 2.0.0
SNAPSHOT 20090924), it is responseText. Since responseText is the property in
the standard XMLHttpRequest, I presume that was what was intended, and Table
14-4 is in error.
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 (data.status == "begin")
{ showSomeAnimatedGifSayingImWorking(); }
else if (data.status == "success")
{ hideSomeAnimatedGifSayingImWorking(); }
}
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.
I would reorder Table 14-3 so that the entries are in chronological order
(begin, complete, success).
The use case of 14.4.1.1 is incorrect.
First, you can't call addOnEvent(statusUpdate) until after the statusUpdate
variable exists. Even it it existed at that point, redefining it later as shown
would have no effect because addOnEvent would have the old value.
Second, I don't understand why it is doing
var statusUpdate = function statusUpdate(data)
{ ... };
instead of just
function statusUpdate(data) { ... }
;
Aren't those two forms equivalent?
I suggest changing the use case of 14.4.1.1 to this:
function statusUpdate(data) {
// do something with data.status or other parts of data payload
}
...
jsf.ajax.addOnEvent(statusUpdate);
I also think that this part of the spec should make it a bit more obvious to
readers that
<f:ajax ... onevent="statusUpdate" /> invokes addOnEvent.
Cheers-
http://www.coreservlets.com
Environment
Operating System: All
Platform: All
URL: http://www.coreservlets.com
Affected Versions
[2.0]
The text was updated successfully, but these errors were encountered: