myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Müller <harald.muel...@wimaxtelecom.at>
Subject Re: datatable - parameter passing - workaround?
Date Wed, 14 Dec 2005 15:09:31 GMT
Sorry ... my mistake ...

The problem is not that every column of each row has the same content (that's exactly what
the code does) ...
but I always get the object of the first row with mRowHolder.getRowData().

Output:

       Col1
Row1   Name_of_row1
Row2   Name_of_row1
Row3   Name_of_row1


And not:

       Col1
Row1   Name_of_row1
Row2   Name_of_row2
Row3   Name_of_row3

Thanks,
Harry




-----Ursprüngliche Nachricht-----
Von: Mathias Brökelmann [mailto:mbroekelmann@googlemail.com] 
Gesendet: Mittwoch, 14. Dezember 2005 15:54
An: MyFaces Discussion
Betreff: Re: datatable - parameter passing - workaround?

2005/12/14, Harald Müller <harald.mueller@wimaxtelecom.at>:
>   private List createColumns()
>   {
>         List result = new ArrayList();
>     result.add(new Column("Col1", this));
>     result.add(new Column("Col2", this));
>     result.add(new Column("Col3", this));
>     // add more columns
>     return result;
>   }

>   public String getValue()
>   {
>         Object rowData = mRowHolder.getRowData();
>     if(rowData != null)
>     {
>         return ((TaskInstance)rowData).getName()+"";
>     }
>     return null;
>   }

you call getName() for every column...

try using the column header to determine which getter you have to call
on the row instance.


--
Mathias

Mime
View raw message