[jira] Commented: (MYFACES-1549) MyFaces-API issue: getValue of UIInput
[ https://issues.apache.org/jira/browse/MYFACES-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477314 ] Martin Marinschek commented on MYFACES-1549: Direct access to UIOutput getLocalValue: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?view=diffrev=513319r1=513318r2=513319 regards, Martin MyFaces-API issue: getValue of UIInput -- Key: MYFACES-1549 URL: https://issues.apache.org/jira/browse/MYFACES-1549 Project: MyFaces Core Issue Type: Bug Components: JSR-127 Affects Versions: 1.1.5 Reporter: Martin Marinschek Assigned To: Martin Marinschek Fix For: 1.1.6-SNAPSHOT UIOutput currently has the following code: public Object getValue() { if (_value != null) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } UIInput has the following code: public void setValue(Object value) { setLocalValueSet(true); super.setValue(value); } My problem (pseudo code): 1) user enters an empty string in an input-component: 2) conversion and validation phase: -- setValue(null); isLocalValueSet = true; setSubmittedValue(null); 3) validation fails in some component on the page -- update model phase is skipped 4) renderer calls getValue(); -- getValue() evaluates the value-binding, as the local-value is 'null', and I get the default-value of the bean shown again proposed solution: UIInput overwrites getValue of UIOutput: public Object getValue() { if (isLocalValueSet()) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (MYFACES-1549) MyFaces-API issue: getValue of UIInput
[ https://issues.apache.org/jira/browse/MYFACES-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477317 ] Martin Marinschek commented on MYFACES-1549: Reduced state-array size again, and tried the fix from the other side as well: the code in RendererUtils has the same problem. http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?view=diffrev=513799r1=513798r2=513799 regards, Martin MyFaces-API issue: getValue of UIInput -- Key: MYFACES-1549 URL: https://issues.apache.org/jira/browse/MYFACES-1549 Project: MyFaces Core Issue Type: Bug Components: JSR-127 Affects Versions: 1.1.5 Reporter: Martin Marinschek Assigned To: Martin Marinschek Fix For: 1.1.6-SNAPSHOT UIOutput currently has the following code: public Object getValue() { if (_value != null) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } UIInput has the following code: public void setValue(Object value) { setLocalValueSet(true); super.setValue(value); } My problem (pseudo code): 1) user enters an empty string in an input-component: 2) conversion and validation phase: -- setValue(null); isLocalValueSet = true; setSubmittedValue(null); 3) validation fails in some component on the page -- update model phase is skipped 4) renderer calls getValue(); -- getValue() evaluates the value-binding, as the local-value is 'null', and I get the default-value of the bean shown again proposed solution: UIInput overwrites getValue of UIOutput: public Object getValue() { if (isLocalValueSet()) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (MYFACES-1549) MyFaces-API issue: getValue of UIInput
[ https://issues.apache.org/jira/browse/MYFACES-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476879 ] Martin Marinschek commented on MYFACES-1549: I added the value in UIInput to the restoreState/saveState-process - see: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?view=diffrev=513253r1=513252r2=513253 regards, Martin MyFaces-API issue: getValue of UIInput -- Key: MYFACES-1549 URL: https://issues.apache.org/jira/browse/MYFACES-1549 Project: MyFaces Core Issue Type: Bug Components: JSR-127 Affects Versions: 1.1.5 Reporter: Martin Marinschek Assigned To: Martin Marinschek Fix For: 1.1.6-SNAPSHOT UIOutput currently has the following code: public Object getValue() { if (_value != null) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } UIInput has the following code: public void setValue(Object value) { setLocalValueSet(true); super.setValue(value); } My problem (pseudo code): 1) user enters an empty string in an input-component: 2) conversion and validation phase: -- setValue(null); isLocalValueSet = true; setSubmittedValue(null); 3) validation fails in some component on the page -- update model phase is skipped 4) renderer calls getValue(); -- getValue() evaluates the value-binding, as the local-value is 'null', and I get the default-value of the bean shown again proposed solution: UIInput overwrites getValue of UIOutput: public Object getValue() { if (isLocalValueSet()) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (MYFACES-1549) MyFaces-API issue: getValue of UIInput
[ https://issues.apache.org/jira/browse/MYFACES-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476878 ] Martin Marinschek commented on MYFACES-1549: I had to change a bit more, cause the value field is private and I couldn't access it from the UIInput. Link to commit log: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?view=diffrev=513252r1=513251r2=513252 regards, Martin MyFaces-API issue: getValue of UIInput -- Key: MYFACES-1549 URL: https://issues.apache.org/jira/browse/MYFACES-1549 Project: MyFaces Core Issue Type: Bug Components: JSR-127 Affects Versions: 1.1.5 Reporter: Martin Marinschek Assigned To: Martin Marinschek Fix For: 1.1.6-SNAPSHOT UIOutput currently has the following code: public Object getValue() { if (_value != null) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } UIInput has the following code: public void setValue(Object value) { setLocalValueSet(true); super.setValue(value); } My problem (pseudo code): 1) user enters an empty string in an input-component: 2) conversion and validation phase: -- setValue(null); isLocalValueSet = true; setSubmittedValue(null); 3) validation fails in some component on the page -- update model phase is skipped 4) renderer calls getValue(); -- getValue() evaluates the value-binding, as the local-value is 'null', and I get the default-value of the bean shown again proposed solution: UIInput overwrites getValue of UIOutput: public Object getValue() { if (isLocalValueSet()) return _value; ValueBinding vb = getValueBinding(value); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.