Goal: Generate tabs dynamically.
Solution: use c:forEach
<c:forEach var="bean" items="#{YourBackendBean.yourList}" >
<p:tab title="#{bean.name}">
<h:outputText value="#{bean.value}" />
</p:tab>
</c:forEach>
While the following things have to be done to make this work:
- use JSP2.1, instead of JSP2.0
- use JSTL1.2. instead of JSTL1.0
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
#2 can be done by putting jstl-1.2.jar in the WEB-INF/lib
No comments:
Post a Comment