Thanks for your reply! That's exactly what I needed. But, now I have
another problem. How can I reference an Object's attribute in a
ArrayList? Follow a simple example (very ugly) :
<x:dataTable value="#{remessaBean.valuesEmbque}" var="values" width="760"
cellpadding="0" cellspacing="1">
<x:columns value="#{remessaBean.fieldsEmbque}" var="field">
<f:facet name="header">
<x:outputText value="#{field.nomeCampoTela}"
styleClass="forms"/>
</f:facet>
<h:outputText value="#{values.Fields.value}" styleClass="forms"/>
</x:columns>
</x:dataTable>
private static final Fields[] fieldsEmbque = new Fields[] {
new Fields(1, "Embarcador", "1", "NUMBER", true, true, "", null),
new Fields(2, "Nº Embarque", "2", "NUMBER", true, true, "", null),
new Fields(3, "Dt. Prevista", "3", "DATE", true, false, "", null),
new Fields(4, "Pedido", "4", "NUMBER", true, false, "", null),
new Fields(5, "Cliente", "5", "NUMBER", true, false, "", null),
new Fields(6, "Local Embarque", "6", "STRING", true, false, "", null),
new Fields(7, "Lote", "7", "NUMBER", true, false, "", null)};
private static final Fields[] fieldsEmbque1 = new Fields[] {
new Fields(1, "Embarcador", "8", "NUMBER", true, true, "", null),
new Fields(2, "Nº Embarque", "9", "NUMBER", true, true, "", null),
new Fields(3, "Dt. Prevista", "10", "DATE", true, false, "", null),
new Fields(4, "Pedido", "11", "NUMBER", true, false, "", null),
new Fields(5, "Cliente", "12", "NUMBER", true, false, "", null),
new Fields(6, "Local Embarque", "13", "STRING", true, false, "", null),
new Fields(7, "Lote", "14", "NUMBER", true, false, "", null)};
private List valuesEmbque;
public RemessaBean () {
valuesEmbque = new ArrayList();
valuesEmbque.add(fieldsEmbque);
valuesEmbque.add(fieldsEmbque1);
}
My problem is the part "values.Fields.value" that didn't work. What can I do?
Thanks.
Guedes
On 10/18/05, Mathias Brökelmann <[EMAIL PROTECTED]> wrote:
> try out the t:columns component which allows you to have NxM tables.
> Take a look into the myfaces-examples (opendatatable)
>
> 2005/10/18, PATRICIA GUEDES <[EMAIL PROTECTED]>:
> > Hi, I´m from Brazil (sorry my bad English) and I need to build a
> > table where the columns are dynamics. The columns came from a
> > ArrayList of "fields" and the lines came from each field's values. How
> > can I do that?
> >
> > Ex:
> >
> > field1 field2 field3 field4 field5 (colunas vêm de um
> > ArrayList de fields)
> > 1 2 3 4 5
> > 6 7 8 9 10
> >
> > Any ideas?
> >
> > Thanks.
> > Guedes
> >
>
>
> --
> Mathias
>