How can I reduce code with PrimeFaces and JSF?
Now I work with JSF and Primefaces, how can I reduce code when I use panel to show list member edit, delete and add? I have 10 panels in 1 page, because I want to create application the same desktop (Ubuntu desktop, Windows desktop, Mac desktop). If I have 10 panels in one page,开发者_如何学Python then I must repeat the same code 10 times to create and handle 10 panels.
How can I reduce this code?
Put that code in an include or a tag file and then render it in a <c:forEach>
or <ui:repeat>
loop which is feeded by a list containing 10 items providing the model for those panels.
Basic kickoff example with a tag file in an <ui:repeat>
:
<ui:repeat value="#{bean.panels}" var="panel">
<my:panel value="#{panel}" />
</ui:repeat>
精彩评论