Hi,

I would like to have a column called index, which shows the number of lines in 
the table.
Furthermore the dynamic table seems to work, but only
the last entry is displayed in all lines in the table.

xhtml:
<t:dataTable id="results"
                        border="1"
                        value="#{proteins.list}"
                        var="line"
                        renderedIfEmpty="false"
                        styleClass="contenttable"
                        headerClass="contenttable"
                        cellspacing="0" cellpadding="3">

               <h:column>
                   <f:facet name="header">
                   <h:outputText value="Index"/>
                   </f:facet>
                   <h:outputText value="#{proteins.index}"/>
               </h:column>


               <h:column>
                   <f:facet name="header">
                   <h:outputText value="Name"/>
                   </f:facet>

                   <h:outputText value="#{line.name}"/>
               </h:column

           </t:dataTable>


Bean:
public class Proteins {

   private int index=0;

   private List list = new ArrayList();

   /** Creates a new instance of StudentBean */
   public Proteins() {

       Dataset set = new Dataset();

       set.setName("Dataset 1");
       set.setInput("This is Dataset 1");
       list.add(set);

       set.setName("Dataset 2");
       set.setInput("This is Dataset 2");
       list.add(set);
   }

   public List getList() {
       return list;
   }

   public void setList(List list) {
       this.list = list;
   }

   public int getIndex() {
       return index;
   }

   public void setIndex(int index) {
       this.index = index;
   }
}


Do anyone know how to get this working?

Cheers Wolfgang


-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

Reply via email to