Java Reference
In-Depth Information
7. <h:head>
8. <title>List of All books</title>
9. <link rel="stylesheet" href="css/bookstore.css" type="text/css" />
10. <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
11. <script src="js/bookstore.js"></script>
12. </h:head>
13. <h:body>
14. <h:dataTable id="grid" value="#{bookController.bookList}" var="book">
15. <h:column>
16. <f:facet name="header" id="th-title">
17. <h:outputText value="Title" />
18. </f:facet>
19. <h:outputText value="#{book.bookTitle}" />
20. </h:column>
21. <h:column>
22. <f:facet name="header" id="th-author">
23. <h:outputText value="Author" />
24. </f:facet>
25. <ui:repeat value="#{book.authors}" var="content">
26. <h:outputText value="#{content.firstName} #{content.lastName}" />
27. </ui:repeat>
28. </h:column>
29. <h:column>
30. <f:facet name="header" id="th-price">
31. <h:outputText value="Publisher" />
32. </f:facet>
33. <h:outputText value="#{book.publisherName}" />
34. </h:column>
35. </h:dataTable>
36. </h:body>
37. </html>
Line 6 : Declares the namespace for the JSF core library
Line 14 : Shows the usage of the h:dataTable tag instead of using the markup
<table/>
Line 14 : Shows the deferred EL expression that uses the bookList property of
the managed bean bookController
Line 15 : Shows the usage of h:column instead of using the markup <td/>
Line 16 : Shows the usage of the f:facet tag to add the facet
Line 17 : Shows the usage of h:outputText that displays the book title
Search WWH ::




Custom Search