You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Dave Brondsema (JIRA)" <de...@myfaces.apache.org> on 2005/11/14 23:48:27 UTC

[jira] Created: (MYFACES-824) if submittedValue==null, required==true not checked

if submittedValue==null, required==true not checked
---------------------------------------------------

         Key: MYFACES-824
         URL: http://issues.apache.org/jira/browse/MYFACES-824
     Project: MyFaces
        Type: Bug
  Components: JSR-127  
    Versions: Nightly    
    Reporter: Dave Brondsema
    Priority: Minor


In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"

This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Resolved: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-824?page=all ]
     
sean schofield resolved MYFACES-824:
------------------------------------

    Resolution: Won't Fix

This is not a bug.  It is part of the spec.  Many have taken issue with it and I believe its being revisited in the next version of the spec.

> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Closed: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-824?page=all ]
     
Martin Marinschek closed MYFACES-824:
-------------------------------------


> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: 1.1.2
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Commented: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-824?page=comments#action_12357637 ] 

Simon Kitching commented on MYFACES-824:
----------------------------------------

I think that submittedValue will be null only if the submitted form did not contain that UIInput component at all.
In this case, validation is *not* required.

When the component is in the form, but has no value, I expect submittedValue is set to an empty string (not null).
See HtmlRendererUtils.decodeUIInput.

> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Commented: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "Dave Brondsema (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-824?page=comments#action_12357644 ] 

Dave Brondsema commented on MYFACES-824:
----------------------------------------

I'm working on a custom component that binds to a Date value.  It calls setSubmittedValue(myDate) but sometimes myDate is null.  You're saying that if myDate is null it should call setSubmittedValue("") instead?  It seems a little weird.

> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Commented: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "Simon Kitching (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-824?page=comments#action_12357646 ] 

Simon Kitching commented on MYFACES-824:
----------------------------------------

I don't understand what you are saying here.

The method setSubmittedValue is only ever called from the decode method of the component's renderer, during the "apply request values" phase of processing. It tells the component what String value was found in the submitted form (ie in the http request paramMap).

If the current page contains two forms, and the input field was in one form but the user submitted the other then on decode the component will see there is *no* value for it in the http request params. I bet in this case _submittedValue is null.

Perhaps this link may be useful: http://wiki.apache.org/myfaces/StudyGuide

> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Commented: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "sean schofield (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-824?page=comments#action_12357660 ] 

sean schofield commented on MYFACES-824:
----------------------------------------

@Adam: Yes that is what I was referring to.  Thanks for the clarification.

> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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


[jira] Commented: (MYFACES-824) if submittedValue==null, required==true not checked

Posted by "Adam Winer (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-824?page=comments#action_12357653 ] 

Adam Winer commented on MYFACES-824:
------------------------------------

It's not a bug, nor is it being revisited.  I'm not aware of many taking issue to this - perhaps you're thinking of the fact that validators are not executed if required is true?

submittedValue being set to null means "nothing was submitted" - which is different from "a null value was submitted", or "the empty string was submitted".  This is the proper value for submittedValue for a disabled or readonly text field, for instance.

This does create some oddities if you want to reflect "the value that was submitted should be null", in which case Renderer.decode() needs to store some non-null value (Boolean.FALSE, etc.), which getConvertedValue() can recognize and change to null.


> if submittedValue==null, required==true not checked
> ---------------------------------------------------
>
>          Key: MYFACES-824
>          URL: http://issues.apache.org/jira/browse/MYFACES-824
>      Project: MyFaces
>         Type: Bug
>   Components: JSR-127
>     Versions: Nightly
>     Reporter: Dave Brondsema
>     Priority: Minor

>
> In UIInput.java, in validate() at line 263 there is "if (submittedValue == null) return;"
> This seems to be incorrect to me.  If submittedValue is set to null, then validate returns without checking to see if required=true.  According to the UIInput spec javadocs " If the component wishes to indicate that no particular value was submitted, it can either do nothing, or set the submitted value to null."

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