Skip to main content

JSF - How to access each row of dataTable as it is created?

No replies
Joined: 2005-08-19

I'm trying to figure out how to access each data item in a dataTable as it is created, in a backing-bean.

I realize that I can bind an HtmlDataTable component to the dataTable but...then what? Is there an event-handler that is fired for each row as it is created? I also realize that I can access the row object by calling the getRowData() method in an action but I don't want to post the form or fire an action...this is a read-only page (report.)

Here's my dataTable (so far):

<p>.............and many other columns beyond this.....</p>

Here's where I've declared the HtmlDataTable in my backing bean:

<br />
public class ChangeOrdersBean<br />
{<br />
  private HtmlDataTable coDataTable;</p>
<p>  public HtmlDataTable getCoDataTable()<br />
  {<br />
    return coDataTable;<br />
<p>  public void setCoDataTable(HtmlDataTable coDataTable)<br />
  {<br />
    this.coDataTable = coDataTable;<br />
  }<br />
}<br /> question is; now what? This builds and runs...but how/where can I access and manipulate each data item (the entity in each individual row) as it is created?

I'm dealing w/ some particularly gnarly legacy data in which the customer is particular in how it is to be displayed, arranged, and converted to different values.

Any advice would be much appreciated, thank you!