UIRepeat component uses getValue() instead of getLocalValue()

View: New views
1 Messages — Rating Filter:   Alert me  

UIRepeat component uses getValue() instead of getLocalValue()

by FlorianMinjat :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I don't know if this problem was already addressed.

I use version jsf-facelets-1.1.14.

The class com.sun.facelets.component.UIRepeat$SavedState has the following code:
public void populate(EditableValueHolder evh) {
    value = evh.getValue();
    valid = evh.isValid();
    submittedValue = evh.getSubmittedValue();
    localValueSet = evh.isLocalValueSet();
}
public void apply(EditableValueHolder evh) {
    evh.setValue(value);
    evh.setValid(valid);
    evh.setSubmittedValue(submittedValue);
    evh.setLocalValueSet(localValueSet);
}


The problem is the use of getValue in the populate method. In case the localValue of the EditableValueHolder is null, it will get the value of the ValueBinding "value". Then when the method apply is called, this value will be stored back as localValue in the EditableValueHolder, therefore preventing further call to the ValueBinding.

This behavior seems wrong and can easily be corrected like this:
public void populate(EditableValueHolder evh) {
    value = evh.getLocalValue();
    valid = evh.isValid();
    submittedValue = evh.getSubmittedValue();
    localValueSet = evh.isLocalValueSet();
}


Regards,
Florian