You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Daniel del Río <da...@programaria.com> on 2008/01/18 19:46:41 UTC

Dynamic clay in a datatable

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="#{@managed-bean-name.jsfid}"/>
              	</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:

- Using a ShapeValidator
- Create a JSF component that adds a clay component
- Extending the Clay component

Thanks in advance.
Daniel del Río.


Re: Dynamic clay in a datatable

Posted by Daniel del Río <da...@programaria.com>.
Finally I found a solution! Thanks Gary to point me on the right way.
In resume, it consists in duplicate the clay component for every
distinct jsfid (every clay page template), and setting the rendered
property accordingly. 
To achieve it the more easy way I found is to create a new jsf component
that adds 1 child for page setting the rendered attribute with a value
expression.

Thanks.

El vie, 18-01-2008 a las 15:06 -0500, Ryan Wynn escribió:
> Could you try first this more direct way and see what happens?
> 
> --------------------
> <t:dataTable value="#{home.banners}" var="c">
>        <t:column>
>                <clay:clay id="prueba" jsfid="#{c.jsfid}"></clay:clay>
>        </t:column>
> </t:dataTable>
> --------------------
> 
> Not sure that the symbol tag is being evaluated in time to be
> available for the clay component.
> 
> I have not used clay's jsp tags but have done something like this
> before with html templates.
> 
> Ryan
> 
> 
> 
> 
> On Jan 18, 2008 1:46 PM, Daniel del Río <da...@programaria.com> wrote:
> > 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="#{@managed-bean-name.jsfid}"/>
> >                 </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:
> >
> > - Using a ShapeValidator
> > - Create a JSF component that adds a clay component
> > - Extending the Clay component
> >
> > Thanks in advance.
> > Daniel del Río.
> >
> >
-- 
------------------------------
Daniel del Río
Software Architect
t. 690211287
e. dani@programaria.com

www.programaria.com
------------------------------


Re: Dynamic clay in a datatable

Posted by Ryan Wynn <bi...@gmail.com>.
Could you try first this more direct way and see what happens?

--------------------
<t:dataTable value="#{home.banners}" var="c">
       <t:column>
               <clay:clay id="prueba" jsfid="#{c.jsfid}"></clay:clay>
       </t:column>
</t:dataTable>
--------------------

Not sure that the symbol tag is being evaluated in time to be
available for the clay component.

I have not used clay's jsp tags but have done something like this
before with html templates.

Ryan




On Jan 18, 2008 1:46 PM, Daniel del Río <da...@programaria.com> wrote:
> 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="#{@managed-bean-name.jsfid}"/>
>                 </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:
>
> - Using a ShapeValidator
> - Create a JSF component that adds a clay component
> - Extending the Clay component
>
> Thanks in advance.
> Daniel del Río.
>
>