Page 1 of 1

Topbar - I need rendered function option

Posted: 14 Jul 2019, 12:39
by vished
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?

Re: Topbar - I need rendered function option

Posted: 18 Jul 2019, 10:29
by aragorn
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,

Re: Topbar - I need rendered function option

Posted: 21 Jul 2019, 20:16
by vished
it´s working, great!

Thank you

Re: Topbar - I need rendered function option

Posted: 22 Jul 2019, 08:16
by aragorn
Glad to hear, thanks a lot for the update!

Best Regards,