Selected menu

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
alvinrd22
Posts: 6
Joined: 15 May 2019, 17:24

01 Feb 2020, 05:35

Hi, to mark the selected menu in the menubar we should use code like this:

<ui:define name="viewname">
<li>Components</li>
<li>/</li>
<li><p:link outcome="/data">Data</p:link></li>
</ui:define>

But I want to create the inner content of the "viewname" dynamically because I create menus dynamically and the same view
can be called from different menus.

Example:

<ui:define name="viewname">
<c:forEach items="#{UIHelper.menutree}" var="menu" varStatus="menuLooper">
<c:choose>
<c:when test="#{!menuLooper.last}">
<li>#{menu}</li>
<li>/</li>
</c:when>
<c:when test="#{menuLooper.last}">
<li><p:link outcome="#{UIHelper.contextPath}">#{menu}</p:link></li>
</c:when>
</c:choose>
</c:forEach>

</ui:define>

I don't know what is "viewname" and the code don't work on the view.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

03 Feb 2020, 09:11

Hi,

Sorry for our typo. Roma doesn't use "viewname" template. While we were copying the demos from other layouts, we forgot to remove it. Sorry again.

But, If you want to use this template, you can add <ui:insert name="viewname" /> to template or topbar.

Best Regards,

alvinrd22
Posts: 6
Joined: 15 May 2019, 17:24

08 Feb 2020, 05:50

I don't understand what you mean when you say "If I want to use it" I just want to know how can I keep the selected menu "Selected" because when I change from a menu to another sometime the menu get contracted or the previous menu keeps selected.

Is the next code used for that?

<li>Components</li>
<li>/</li>
<li><p:link outcome="/data">Data</p:link></li>
In that case it looks like is not working.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

28 Feb 2020, 11:57

Hi,

This is a typo. This layout doesn't have a style or element to support "viewname" template. Therefore, you can write custom styles and html codes for it. You can start by adding <ui:insert name="viewname" /> to template or topbar.

As you know, our live demo doesn't have it. This is a typo in the source code.


Best Regards,

Post Reply

Return to “Roma - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests