Let me clarify that last question. In all the dataTables in my present application they are populated by Collections

Collection <SomeKindOfObject> SomeKindOfCollection

My thinking was that if I could access the HtmlOutputText of the table rows I wouldn't have to know what kind of object was used to populate my Collection. Also, In this way I could also look to see if the column was rendered or not and if it wasn't I could exclude that column from my loop and not include it in the new table on the new page (excel doc really).

Also, if I didn't have to know the object I could use the method over and over for all my dataTables.

Is my thinking correct or am I driving down the wrong road? Is it at all possible to directly access the HtmlOutputText objects in the rows of an HtmlDataTable?

Dennis

Dennis Gesker wrote:
Is it possible to return the model behind the table in a generic way so that I don't have to know what kind of object was used to populate the dataTable to begin with? Perhaps to access the values by knowing the column number and row number?

Dennis

Virtudazo, Dennis (Exchange) wrote:
Better to iterate through the table model rather than the component.

-----Original Message-----
From: Dennis Gesker [mailto:[EMAIL PROTECTED] Sent: Thursday, July 13, 2006 4:32 PM
To: [email protected]
Subject: [OT?] HtmlDataTable Children?

Could someone point me to some sample code that would be an example of
how to get at the HtmlOutputText children of a myfaces HtmlDataTable?

I have been able to get/iterate the children of the header and footer
but I can't seem to reach the HtmlOutputText for the actual rows of the
HtmlDataTable.

My goal is to have a link that will let the user dump out an already
generated/sorted dataTable to excel.
My planned approach is as follows:

Bind the dataTable to an HtmlDataTable object in my backing bean.
Loop/Iterate through the HtmlDataTable adding the values of the
HtmlOutputText children to an ArrayList of String.
Loop through the ArrayList adding the html tags and put the output into
PrintWriter Change the content type to application/vnd.ms-excel

Or along the same lines is it possible to get hold of an already
existing HtmlDataTable and hand it back out to a new page using
PrintWriter? I just want to be able to implement in a very generic way
so I can use this functionality for other parts of my application.

Any help or hints would be really appreciated.

Dennis




***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication.
***********************************************************************


--
Dennis R. Gesker
email: [EMAIL PROTECTED]
Key Id: 0xEFA10A51

Reply via email to