myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Renzo Tomaselli <>
Subject Re: Dynamic ID with el not working
Date Wed, 26 Nov 2008 19:08:06 GMT
Hi Piercarlo,
    there is a dirty trick with Facelets: it evaluates the EL for any ID 
only the first time - while the tag tree is evaluated and components are 
created if needed (there is a component cache idea behind this concept).
This occurs during the "apply" deep scan (view building at render time).
Someone call it  "Facelets compilation" - but in my opinion this is 
At the same time it's somewhat misleading that tag libraries 
documentation usually reports "supports EL ? no" for the component ID 
attribute (e.i. Trinidad).
Having said that - there is a simple trick with Facelets to force 
recreation of any component ID whenever necessary: get the component 
parent through the "binding" attribute, then clean its children when 
needed, something like "boundParent.getChildren().clear()".
This way at rendering time the view creation will build the target 
component again - and Facelets will ask the bean to provide (possibly 
new) EL parameters.
This applies to any case when we deal with so-called "compile-time" 
parameters (e.i. c:forEach loop is another good example).
Hope it helps,

-- Renzo Tomaselli

Pierandrea Cercato wrote:
> I tried first  (see the first post)  without any facelets component 
> but was not working. Then as suggested i created a facelts component 
> but i was not successful anyway. Is there anyway to pass a dynamic id 
> to a component?
> Please any idea?

View raw message