Topbar - I need rendered function option

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
vished
Posts: 479
Joined: 02 Feb 2014, 17:38

14 Jul 2019, 12:39

Hi all,

In the topbar.xhtml we have code like this:

Code: Select all

<ul class="animated">
					<li role="menuitem"><p:link
							outcome="/portal/offerEdit.jsf">
							<i class="fa fa-fw fa-file-text-o"></i>
							<span>Angebot erstellen</span>
						</p:link></li>
But I need now to hide or to show this menu entry. For p:link I can add the rendered function, but I need it also for <li role="menuitem">.
How can I do this?
PF 8.0

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

18 Jul 2019, 10:29

There are two ways to fix it;
The first solution, you can use Pass-Through feature of JSF2.2+. Please see; https://docs.oracle.com/javaee/7/tutori ... ets009.htm

Code: Select all

xmlns:jsf="http://xmlns.jcp.org/jsf"

<li role="menuitem" jsf:rendered="false">
                        <p:link outcome="/portal/offerEdit.jsf">
                            <i class="fa fa-fw fa-file-text-o"></i>
                            <span>Angebot erstellen</span>
                        </p:link>
 </li>
The second solution, you can use c:if tag.

Best Regards,

vished
Posts: 479
Joined: 02 Feb 2014, 17:38

21 Jul 2019, 20:16

it´s working, great!

Thank you
PF 8.0

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

22 Jul 2019, 08:16

Glad to hear, thanks a lot for the update!

Best Regards,

Post Reply

Return to “Morpheus - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests