Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Duplicate
-
1.1.5
-
None
-
None
Description
"java.lang.IllegalArgumentException: Value is no String" error is caused in all select one components in both CORE and TOMAHAWK due to the usage of RendererUtils.NOTHING class.
Instead of using "((EditableValueHolder) component).setSubmittedValue(null);" in HtmlRendererUtils, the following code is used:
((EditableValueHolder) component).setSubmittedValue(RendererUtils.NOTHING);
This NOTHING is not a valid submitted value for select one component and causes errors.
The stack trace is:
...does not have a Converter
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:513)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:95)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:256)
at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:232)
at org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
...
During rendering of the component, the NOTHING is not null and not a string, so therefore the error is thrown. This is a critical error as it breaks the entire page and the user is left viewing an error page.
Proposed fix: remove the NOTHING variable from RendererUtils and use null instead. The only code that actually cares about NOTHING is in HtmlRendererUtils:
UISelectOne uiSelectOne = (UISelectOne) uiComponent;
Object lookup = uiSelectOne.getSubmittedValue();
if (lookup == null)
else if (org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.NOTHING.equals(lookup))
{ lookupSet = Collections.EMPTY_SET; }I don't see why it is done this way. It may be possible to use isLocalValueSet instead (setLocalValueSet(true); setSubmittedValue(null). This way, it can be checked that a value was submitted, but the value was null. If this proposed fix is not acceptible, "org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:513)" needs to be fixed to handle NOTHING values.
Attachments
Attachments
Issue Links
- is duplicated by
-
MYFACES-1891 ClassCastException in converter when Hiding / Showing unselected selectOneRadio
- Closed