You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Kołoszko Paweł <pa...@atena.pl> on 2005/08/17 13:02:59 UTC

How to get cell value from HtmlDataTable?

I would like to iterate over HtmlDataTable and get value stored in each
cell. How can I do this?
 
Paweł Kołoszko

Re: How to get cell value from HtmlDataTable?

Posted by Mike Kienenberger <mk...@gmail.com>.
You can iterate over the rows using HtmlDataTable.setRowIndex(rowIndex).
To iterate over the columns, you'd have to provide your own custom
logic, or you would have to wander through the children and facets of
the table looking for appropriate components (like h:column and
t:column and then somehow pick out your data from the children of
those column components).

If it were me, I'd use a single t:columns (with an 's') component
instead of groups of h:column or t:column components to represent all
of your columns.   columns is a UIData component just like
HtmlDataTable, and you can use it to iterate through your columns in
the same way that you iterate through your rows (setRowIndex() is
really setColumnIndex() for t:columns).

-Mike

On 8/17/05, Kołoszko Paweł <pa...@atena.pl> wrote:
> I would like to iterate over HtmlDataTable and get value stored in each
> cell. How can I do this?
> 
> Paweł Kołoszko
>