tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44928] Submitting empty text in inputText results in Integer with value '0' being set in backing bean (ELSupport)
Date Sat, 03 May 2008 10:16:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44928





--- Comment #2 from Errorken <errorken@yahoo.com>  2008-05-03 03:16:51 PST ---
Yes, you are right, thanks.

But why are there differences between the sun EL RI and apache's one?
Further more, why on earth is the spec saying that null should be converted to
0? Thats sounds like fuzy logic behavior to me.

Also, if I add a validator to the inputText, like:

<h:inputText value="#{testBean.integer}" required="false">
    <f:validateLongRange minimum="5" maximum="10"/>
</h:inputText>

Now it gets even more wrong. The first time I enter no value => submit
succeeds. In my backing bean I'm receiving '0' which is normally not possible
since the validator is forcing a value from 5 till 10.

Then, when the page is re-rendered, a '0' appears in the text field since the
value on the backing bean has become '0'. If I then re-submit again, I get a
validation error "Validation Error: Specified attribute is not between the
expected values of 5 and 10".

So, besides the fact this is setting values on my backing bean which are
normally not allowed, imagine that I have a search page in wich I have like 5
numerical fields which are not required but must have a value greater then 0.
The user will have to manually blank these fields out after each submit then?
(if he leaves these fields empty in the first submit)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message