1

When generating multiple datatables I need to set dynamic id for each table in order to export the data.

Here is the following code I expected to work:

<ui:repeat value="#{beans}" var="bean">
 <h:commandLink>
   <h:outputText value="Export"/>
   <p:dataExporter type="xls" target="#{bean.id}" fileName="exp" pageOnly="true"/>         
 </h:commandLink>
 <p:dataTable value="#{bean.items}" var={item}>
   <c:set target="#{component}" property="id" value="#{bean.id}"/>
  .
  .
 </p:dataTable>
</ui:repeat>

Instead, It says component not found. Checking the html of the datatable shows that id is not set.

Setting the id immediatelly to the table results in error of 'Empty id not allowed'.

Anyone have solution for this?

Thank you

Smolda
  • 882
  • 5
  • 13
  • 34

0 Answers0