[
https://issues.apache.org/jira/browse/MYFACES-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12802782#action_12802782
]
Ingo Hofmann commented on MYFACES-2497:
---------------------------------------
Fix:
Add in myfaces-api - javax.faces.component.UIInput.validate(FacesContext
context) the line "setValue(null)" as you can see below:
String contextParam =
context.getExternalContext().getInitParameter(EMPTY_VALUES_AS_NULL_PARAM_NAME);
if (contextParam != null &&
contextParam.toLowerCase().equals("true"))
{
if (submittedValue.toString().length() == 0)
{
setSubmittedValue(null);
submittedValue = null;
setValue(null);
}
}
> INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL on required fields
> ------------------------------------------------------------------
>
> Key: MYFACES-2497
> URL: https://issues.apache.org/jira/browse/MYFACES-2497
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Affects Versions: 2.0.0-alpha
> Reporter: Ingo Hofmann
> Attachments: interpret_empty_string_testcase.patch
>
>
> Similar issue as seen in 1.1.6 and 1.2.6.
> 1.) set property javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
> = true.
> 2.) Have an input field with required="true".
> 3.) User enters empty string.
> 4.) After submitted the form, the input field shows its previous value (is
> not empty, as entered before and expected).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.