cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20736] - JXForms validator rejects null value for numeric field
Date Mon, 16 Jun 2003 10:14:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20736>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20736

JXForms validator rejects null value for numeric field





------- Additional Comments From u.cei@cbim.it  2003-06-16 10:14 -------
I've attached a patch file that apparently fixes this bug, but it's more of a
workaround than a real fix. The problem seems to be that, when your form model
has an attribute of a type derived from java.lang.Number and this attribute is
null, the calls

        Pointer pointer = jxcontext_.getPointer(xpath);
        Object property = pointer.getNode();

will return a value of "null" for "property" and it's impossible (AFAIK) to
determine that this is actually a "(java.lang.Number) null" using instanceof.
Thus, you cannot convert the empty string posted by the browser to a null value
only if the property is a Number.

However, the attached patch seems not to break anything in the samples and my forms.

Mime
View raw message