You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Marcio Jose Coelho <co...@consistem.com.br> on 2011/10/20 13:51:18 UTC

Trinidad

Hi..
I am need to create trinidad component to render a dynamic table form a 
bean class.
This component render cells and rows from config properties.
I created xhtml page with this config:
<trh:tableLayout width="100%">
<ui:repeat value="#{tabela.atributo}" step="2" var="item" 
varStatus="status">
<trh:rowLayout>
<tr:iterator value="#{tabela.atributo}" var="el" first="#{status.index}" 
rows="2">
<trh:cellFormat width="20%">
<tr:outputLabel value="#{el.nome}:&nbsp;" />
</trh:cellFormat>
<trh:cellFormat width="30%">
<tr:inputText value="#{el.valor}" />
</trh:cellFormat>
</tr:iterator>
</trh:rowLayout>
</ui:repeat>
</trh:tableLayout>

This reder a from table like this:
| label | inputText | label | inputText|
| label | inputText | label | inputText|

I need create a page like this:

| label | inputText | label | inputText|
| label | inputText                             |
| label | inputText                             |
| label | inputText | label | inputText|

For this need. I think about custom component, extend from tableLayout:
But.. how to Create ui:repeat, trh:rowLayout, and trh:cellFormat in java 
class?
someone know how I can start this component?
Tanks..

-- 

Re: Trinidad

Posted by Scott O'Bryan <da...@gmail.com>.
You create the components directly from your component and add them to
the component tree as children.

Sent from my iPhone

On Oct 20, 2011, at 5:52 AM, Marcio Jose Coelho <co...@consistem.com.br> wrote:

> Hi..
> I am need to create trinidad component to render a dynamic table form a bean class.
> This component render cells and rows from config properties.
> I created xhtml page with this config:
>     <trh:tableLayout width="100%">
>         <ui:repeat value="#{tabela.atributo}" step="2" var="item" varStatus="status">
>             <trh:rowLayout>
>                 <tr:iterator value="#{tabela.atributo}" var="el" first="#{status.index}" rows="2">
>                     <trh:cellFormat width="20%">
>                         <tr:outputLabel value="#{el.nome}:&nbsp;" />
>                     </trh:cellFormat>
>                     <trh:cellFormat width="30%">
>                         <tr:inputText value="#{el.valor}" />
>                     </trh:cellFormat>
>                 </tr:iterator>
>             </trh:rowLayout>
>         </ui:repeat>
>     </trh:tableLayout>
>
> This reder a from table like this:
> | label | inputText | label | inputText|
> | label | inputText | label | inputText|
>
> I need create a page like this:
>
> | label | inputText | label | inputText|
> | label | inputText                             |
> | label | inputText                             |
> | label | inputText | label | inputText|
>
> For this need. I think about custom component, extend from tableLayout:
> But.. how to Create ui:repeat, trh:rowLayout, and trh:cellFormat in java class?
> someone know how I can start this component?
> Tanks..
>
> --
> <Assinatura_Marcio.jpg>

Re: Trinidad

Posted by Walter Mourão <wa...@gmail.com>.
I would suggest you create a composite component...

Walter Mourão
http://waltermourao.com.br
http://arcadian.com.br
http://oriens.com.br



On Thu, Oct 20, 2011 at 9:51 AM, Marcio Jose Coelho <coelho@consistem.com.br
> wrote:

>  Hi..
> I am need to create trinidad component to render a dynamic table form a
> bean class.
> This component render cells and rows from config properties.
> I created xhtml page with this config:
>     <trh:tableLayout width="100%">
>         <ui:repeat value="#{tabela.atributo}" step="2" var="item"
> varStatus="status">
>             <trh:rowLayout>
>                 <tr:iterator value="#{tabela.atributo}" var="el"
> first="#{status.index}" rows="2">
>                     <trh:cellFormat width="20%">
>                         <tr:outputLabel value="#{el.nome}:&nbsp;" />
>                     </trh:cellFormat>
>                     <trh:cellFormat width="30%">
>                         <tr:inputText value="#{el.valor}" />
>                     </trh:cellFormat>
>                 </tr:iterator>
>             </trh:rowLayout>
>         </ui:repeat>
>     </trh:tableLayout>
>
> This reder a from table like this:
> | label | inputText | label | inputText|
> | label | inputText | label | inputText|
>
> I need create a page like this:
>
> | label | inputText | label | inputText|
> | label | inputText                             |
> | label | inputText                             |
> | label | inputText | label | inputText|
>
> For this need. I think about custom component, extend from tableLayout:
> But.. how to Create ui:repeat, trh:rowLayout, and trh:cellFormat in java
> class?
> someone know how I can start this component?
> Tanks..
>
> --
>