[ 
https://issues.apache.org/jira/browse/MYFACES-2915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908598#action_12908598
 ] 

Leonardo Uribe commented on MYFACES-2915:
-----------------------------------------

I have checked and done some examples, and the patch proposed is related to 
another problem in EL api. 

The problem resides in the coercion rules used by EL. The patch just override 
them but only partially. If the EL is more complex than a single expression, it 
is coerced using the standard rules (because the expression is parsed into sub 
expressions internally by the EL implementation). Note the patch also has the 
effect that all EL expressions created by facelets are affected, so if the user 
creates an expression directly using the expression factory it is expected the 
original rules applies.

The solution is override the EL coercion rules. It is known libraries like 
"juel" provides a way outside EL spec to override these rules(see 
http://juel.sourceforge.net/guide/advanced/index.html Advanced Topics - 
Customizing Type Conversion). In this case, I don't think add a param to 
myfaces or mojarra could result in the expected behavior for all cases, so 
apply this patch could unfortunately lead to inconsistencies.

> UIComponent attribute defaults are not used when bound to managed bean 
> property by EL, even if the managed bean property is null
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2915
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2915
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: JSR-314
>    Affects Versions: 2.0.1
>            Reporter: Hanspeter Dünnenberger
>         Attachments: ComponentAttributeValueExpression.patch
>
>
> As asked by Leonardo I open this issue in relation to issue 
> https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1805 on mojarra 
> to check if MyFaces can do the same. For full description see issue above, 
> short description below:
> Assigning a UIComponent attribute with EL expression disables the default 
> value handling that some attribute feature (e.g. rendered==null is the same 
> as rendered==true). Since EL expression never evaluates to null an expression 
> like rendered="#{bean.rendered} with bean.rendered=null will evaluate to 
> False, since for the rendered attribute the expected type for the 
> ValueExpression is Boolean. 
> The proposed change would be to use Object as expected type to allow null 
> evaluation from EL and convert to the really expected type later in 
> TagValueExpression. For details see original issue 1805 on mojarra.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to