myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curtiss Howard <>
Subject Possible issue for the EG regarding CC attributes EL resolver
Date Thu, 03 Sep 2009 14:11:48 GMT

I've got a bug I need to fix related to composite component attribute
handling and I think this might be a possible issue to raise for the
EG.  Here's the background:

We've got a page defined roughly as such:

<h:form id="form1" prependId="false">
  <ez:spinner value="#{number.number}" increment="10"/><br/>
  <h:outputText value="Last number submitted: #{number.number}" /><br/>
  <h:commandButton value="reload" type="submit"/><br/>

The composite component implementation for <ez:spinner> is essentially
a text field with some buttons.  The value it references is

The problem I'm seeing is that when I submit a value the text field
updates with the new value, but the <h:outputText> will always output
the original value (0 in this case).  What's happening is that the
composite component attribute map's "value" attribute is getting
updated, but #{number.number}, what #{cc.attrs.value} _really_ points
to, does not.  The reason for this discrepancy is what makes me think
this is something in the spec that needs to be addressed.

According to the spec, the CC attributes EL resolver's setValue()
method needs to retrieve the component's attributes map and call
getValue().  If the result is a ValueExpression, call setValue(),
which will in turn update the underlying bean property.  Otherwise, do
the default, which is to simply update the CC attributes map.  The
problem is that the component's getAttributes().get() method will
auto-evaluate all ValueExpressions, so the CC attributes EL resolver
never gets a _chance_ to see a ValueExpression.  This is by design in
the spec, so I'm confused as to how this is supposed to work.  So far,
I'm thinking that _ComponentAttributesMap() should have an alternate
form of get() that will not evaluate ValueExpressions.  What does
everyone else think?


Curtiss Howard

View raw message