RowKeySetAttributeChange calls into model when component is not in context
--------------------------------------------------------------------------

                 Key: TRINIDAD-2112
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2112
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions:  1.2.12-core
            Reporter: Prakash Udupa


RowKeySetAttributeChange has this code...

  private void _updateRowKeySetInPlace(UIComponent component, String attrName, 
RowKeySet newValue)
  {

    // Check whether the remembered RowKeySet object is in a valid state
(iterable).
    try
    {
      newValue.iterator().hasNext();
    }
    catch (Exception e)
    {
      _LOG.warning("FAILED_ROWKEYSETATTRIBUTECHANGE", e.getClass());
      return;
    }
    ValueExpression oldExpression = component.getValueExpression(attrName);


At the point when this is executed, the component is not brought into context, 
so the model bindings might be stale. Consequently call to to model objects 
from specific implementation of RowKeySet that relies on the component being 
brought to context would break. We had one such instance that broke badly in 
our app.

The fix is to bring call to newValue.iterator().hasNext(); into 
invokeOnComponent() in the same class file, because at this time the component 
is in context and all will be well.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to