Dynamic menu with c: foreach and bootstrap

0

I'm having trouble implementing the menu using c:foreach . The menu appears only that it does not load the submenus.

My parent list loads all data from the menu table with the null parent field. And the todosFilhos list loads all data from the menu table that has the non-null parent field.

How to solve the problem?

Here's the part of the code that implements:

<ul>
    <c:forEach var="pai" items="#{manageBean.todosMenus}">
        <c:if test="#{pai.link eq null}">
            <li>
                <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">
                    #{pai.nome}
                <i></i>
                </a>
            </li>
        </c:if>
        <c:if test="#{pai.link ne null}">
          <c:forEach items="#{manageBean.todosFilhos}" var="filhos">
              <c:if test="#{not empty filhos.link and filhos.nome ne pai.nome}">
                <ul>
                    <li>
                        <h:form>
                            <h:link outcome="#{filho.link}">
                                <i class="fa dropdown-icon "></i>
                                #{filho.nome}
                            </h:link>
                        </h:form>
                    </li>
                </ul>
                </c:if>
            </c:forEach>
        </c:if>
    </c:forEach>
</ul>
    
asked by anonymous 23.10.2018 / 20:58

0 answers