Highlighting of menu items not cleared out on clicking a different menu item

Post Reply
swordblazer
Posts: 4
Joined: 12 Oct 2017, 10:15

12 Oct 2017, 12:35

I have a code in the left navigation menu which is something like below -

Code: Select all

          <pa:tab
				icon="search"
				title="Search">
				<h:form id="menu-form1">
					<pa:menu widgetVar="me">
						<p:menuitem
							id="um_search"
							value="Client Search"
							outcome="clientSearchPage" />
					</pa:menu>
				</h:form>
			</pa:tab>
			<pa:tab
				icon="add"
				title="Add Client">
				<h:form id="menu-form2">
					<pa:menu widgetVar="me">
						<p:menuitem
							id="um_addclient"
							value="Add Client"
							outcome="addClientPage" />
					</pa:menu>
				</h:form>
			</pa:tab>
The issue is that the <p:menuitem> components are under different <pa:tab> components but when I am clicking them one after the other, both remain highlighted instead of only one item (the latest clicked one) being highlighted at a time. Am I doing something wrong?

Can someone please assist?
Thanks

User avatar
aragorn
Posts: 2926
Joined: 29 Jun 2013, 12:38

16 Oct 2017, 08:41

This is an expected behavior. Each menu component has the stateful feature in itself. You can override the methods that this feature uses in layout.js.

swordblazer
Posts: 4
Joined: 12 Oct 2017, 10:15

16 Oct 2017, 08:47

Would you be so kind as to provide the overridden code? Or at least hint for the parts of the code which need overriding?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest