[richfaces-issues] [JBoss JIRA] Resolved: (RF-1837) make Mask JavaScript API (v0.4b) not work. event return null

Pavel Yaschenko (JIRA) jira-events at lists.jboss.org
Fri Apr 25 12:48:19 EDT 2008


     [ http://jira.jboss.com/jira/browse/RF-1837?page=all ]

Pavel Yaschenko resolved RF-1837.
---------------------------------

    Resolution: Done

Bad integrationn of MASK API bug with prototype.

In IE event doesn't come in first parameter(event) of handler. In IE you should'nt use first parameter as event. You should use window.event .

function $addEvent(o, _e, c, _b){
	var e = _e.toLowerCase(), b = (typeof _b == "boolean") ? _b : true, x = (o[e]) ? o[e].toString() : "";
	// strip out the body of the function
	x = x.substring(x.indexOf("{")+1, x.lastIndexOf("}"));
	x = ((b) ? (x + c) : (c + x)) + "\n";
***	return o[e] = (!!window.Event) ? new Function("event", x) : new Function(x);
}

Prototype defines window.Event for All browsers, so wrong event handler function defined in this line for IE:
return o[e] = (!!window.Event) ? new Function("event", x) : new Function(x);

must be second function, not first.


> make Mask JavaScript API (v0.4b) not work. event return null
> ------------------------------------------------------------
>
>                 Key: RF-1837
>                 URL: http://jira.jboss.com/jira/browse/RF-1837
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.1.1
>            Reporter: au lai seong
>         Assigned To: Pavel Yaschenko
>             Fix For: 3.2.1
>
>         Attachments: 111111_files.zip
>
>
> javascript.PrototypeScript.jsf file make Mask JavaScript API (v0.4b) not work. There event in the following code get null. Why?
> $addEvent(o, "onkeyup", "return " + this.ref + ".getKeyPress(event, this);", true);
> The attactment come with the sample with error.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list