From: Daniel del Río <[EMAIL PROTECTED]> 

> Hello, I know similar questions was made in the past but I haven't found 
> a response. I'm trying to render an HTML that depends of the current 
> datatable row value, but the result is that all render the same page: 
> 
>This is the code:
>
>--------------------
><t:dataTable value="#{home.banners}" var="c">
>       <t:column>
><clay:clay id="prueba" jsfid="WDynamicClay" managedBeanName="c">
>               <c:symbol name="page" 
>value="[EMAIL PROTECTED]"/>
>               </clay:clay>
>       </t:column>
></t:dataTable>
>--------------------
>
>And "WDynamicClay" is an xml component definition:
>
>--------------------
><component jsfid="WDynamicClay" extends="clay">
 ><attributes>
>            <set name="clayJsfid" value="@page"/>
>        </attributes>
></component>    
>--------------------
> 
> The managedBeanName's attribute "jsfid" returns a different clay html 
> template 
> but always the last template is rendered. 
> I tried other alternatives but always with identical result: 
> 

Unfortunately, you can not use Clay this way in a dataTable.  A data table is a 
UIData component.  These types of components implement the flyweight pattern.  
One set of component definitions for a column is applied to each row as the 
model as it is iterated over.  For this to work, the clay component would need 
to rebuild the subtree for each row.  I'm pretty sure that only one attempt to 
find the clay config beans that build the subtree is made.  The subtree creates 
"first class components" that are added to the component tree under the clay 
component (children).  A dynamic subtree in a datatable would most likely cause 
all kinds of problems with state saving too.
   

> - Using a ShapeValidator 
> - Create a JSF component that adds a clay component 
> - Extending the Clay component 
> 
> Thanks in advance. 
> Daniel del Río. 
> 

Gary

Reply via email to