Search code examples
javajspjsfjavabeans

How to load dynamic content in JSF table


I have a webpage with a table layout in it which is develop using JSF. The data, including header and content value, inside the table should be dynamically load. My current challenge is different source coming into this JSF page will have different row's of records. May I know how this can be done? Am I require a Java Bean to achieve my objective?


Solution

  • You can easily use beans for that. Usually the content of the table will go from the database. So in the datatable you can just use value="#{yourbean.contentList}". And the contentList will be retrieved based on the id of the desired data which can be set by the request params.