I use bootfaces in my JSF project, component:

<b:listLinks> <b:navLink href="....xhtml" value="name1" /> <b:navLink href="....xhtml" value="name2" /> </b:listLinks> 

In the database there is a table with a list: name - address. How to implement dynamic building a list of links to pages from the database? That is, I add the link to the table and when the page is reloaded it appears.

    1 answer 1

    On the demo page of the framework you are Sidebar using ui:repeat there is an example of Sidebar using ui:repeat , I think this is exactly what you need. Here is a slightly revised example from their site:

     <b:listLinks> <ui:repeat var="musicStyle" value="#{navLinkBean.musicStyles}"> <b:navLink href="#{musicStyle.link}" value="#{musicStyle.name}" /> </ui:repeat> </b:listLinks> 

    navLinkBean.musicStyles should return a list of links. musicStyle is an instance of an object from the list, it must contain " name - address " in the name and link fields, respectively.

    PS I strongly recommend that you familiarize yourself with all the components of the framework on its demo page before you start working with it, at least briefly.

    • Thank you very much! Exactly what is needed. It seemed to look through and read the page many times, and this moment slipped away. Just mastering the technology. - ezhov_da