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