-
1. Re: excelExporter - dataTable; only getting headers
danielc.roth Nov 15, 2008 12:37 AM (in response to chris.simons)Depending on your richfaces data, it might not work. Try a regular h:dataTable
-
2. Re: excelExporter - dataTable; only getting headers
chris.simons Nov 15, 2008 9:55 PM (in response to chris.simons)Daniel,
I've been able to get the exporter to work with RF data tables except in the following two circumstances (either or, not sure at this point):
1) A facelet (ui:include) is used within a rich:column
2) The data value for the column calls an @Transient method.
3) Both of the above.Example of facelet:
<rich:column sortBy="#{address.fullAddress}" selfSorted="#{!englinkUtil.isPrintDecorator(facesContext)}"> <f:facet name="header"> <h:outputText value="Address" /> </f:facet> <!-- Include Full Address template --> <ui:include src="/layout/objects/fullAddress.xhtml" > <ui:param name="address" value="#{address}" /> </ui:include> </rich:column>
The @Transient method called above:
@Transient public String getFullAddress() { String address; address = this.postOfficeBox + " " + this.primaryAddressLine + " " + this.secondaryAddressLine; address += " " + this.city; if (this.country.getName() == "US") address += ", " + this.state + " " + this.zipCode; else address += ", " + this.country.getName() + " " + this.zipCode; return address; }
With your knowledge of the Excel exporter, would you say that you know issue might be the culprit? And, furthermore, do you think there would be a work-around possible or perhaps a necessary fix for a future version?
Thanks for your time!
-
3. Re: excelExporter - dataTable; only getting headers
nickarls Nov 17, 2008 9:21 AM (in response to chris.simons)Post separate JIRAs with xhtml + backing beans that can be dropped into the excel example. Stepping through it with a debugger should reveal some insights.
-
4. Re: excelExporter - dataTable; only getting headers
danielc.roth Nov 17, 2008 9:30 PM (in response to chris.simons)1) We do something like getDataTable().getValue().getWrappedData(). If it isn't a of the types supported (DataModel, List, Collection etc.) it won't work. Then we process that data for each UIColumn. In case of a rich:column it might be problem since it is possible to have colspans and so forth. Look at the excel example. It has a fully working exportable richfaces table.
2) Se above. We do just that. If JSF for some reason doesn't get the transient data, we won't either.
It's no magic on excel's behalf, we just get the data that represents the table.
-
5. Re: excelExporter - dataTable; only getting headers
kpoudosu Jan 21, 2011 11:23 AM (in response to chris.simons)Please how did you get it to work, exporting all the contents including the header, i am facing the same issue...
Thanks