Page 1 of 1

Search in menu

Posted: 11 Oct 2017, 13:17
by mhm.ghanem
I am trying to have a feature to search in menu. I put a search input text above menu and on key up it updates menu. The case is that menu items that match my search criteria appear as blank unless I click the icon of the module, the other strange thing is that Profile & Notification buttons become not clickable.

You can view it life here:
http://82.212.87.26:9991/ereg-admission-web

Login as admin/admin123 . open the menu in the right you will find a search box, enter the text 'param' and notice that menu results are blank, if you click the icon the item shows, and if you try to click on profile or notifications they don't respond.

The code of menu.xhtml is attached

Code: Select all

<h:form id="menuFrm">
		<div class="layout-sidebar #{guestPreferences.darkMenu ? 'layout-sidebar-dark': ''}">
			<p:inputText placeholder="" value="#{menuMB.searchText}" styleClass="search-menu" autocomplete="false">
				<p:ajax event="keyup" delay="1000" listener="#{menuMB.searchMenu}" update="@form"  />
			</p:inputText>
			<pa:tabMenu id="tabMenu">
				<c:if test="${not empty menuMB.systemMenuMap.get(sys.GENERAL_SETTINGS)}">
					<pa:tab id="generalSettings" icon="subject" title="#{msgs.getLabel('menu.generalSettings')}"
						rendered="#{not empty menuMB.systemMenuMap.get(sys.GENERAL_SETTINGS)}">
						<h:form id="menu-form">
							<pa:menu id="gsMenu" widgetVar="me1" model="#{menuMB.getMenuModelForSystem(sys.GENERAL_SETTINGS)}" />
						</h:form>
					</pa:tab>
				</c:if>

				<c:if test="${not empty menuMB.systemMenuMap.get(sys.ACADEMIC_SETTINGS)}">
					<pa:tab id="academicSettings" icon="school" title="#{msgs.getLabel('menu.academicSettings')}"
						rendered="#{not empty menuMB.systemMenuMap.get(sys.ACADEMIC_SETTINGS)}">
						<h:form id="menu-form2">
							<pa:menu id="acdMenu" widgetVar="me2" model="#{menuMB.getMenuModelForSystem(sys.ACADEMIC_SETTINGS)}" />
						</h:form>
					</pa:tab>
				</c:if>

				<c:if test="${not empty menuMB.systemMenuMap.get(sys.ADMISSION)}">
					<pa:tab id="admission" icon="account_balance" title="#{msgs.getLabel('menu.admission')}"
						rendered="#{not empty menuMB.systemMenuMap.get(sys.ADMISSION)}">
						<h:form id="menu-form3">
							<pa:menu id="adMenu" widgetVar="me3" model="#{menuMB.getMenuModelForSystem(sys.ADMISSION)}" />
						</h:form>
					</pa:tab>
				</c:if>
			</pa:tabMenu>
		</div>
	</h:form>

Re: Search in menu

Posted: 16 Oct 2017, 14:55
by mhm.ghanem
Any one can help in this please ?

Re: Search in menu

Posted: 01 Nov 2017, 11:17
by aragorn
I think it is not a Barcelona Layout or Theme. I think you need to check your search method and create new menu model after the search.

Re: Search in menu

Posted: 06 Nov 2017, 10:19
by mhm.ghanem
Actually it is not related to search method I am using, I just put an action that just updates the menu and got the same result !

Re: Search in menu

Posted: 01 Dec 2017, 11:01
by cagatay.civici
I'd just do the search at client side and hide the elements like we did at PrimeFaces showcase, you may get the code from github as well to see how we did the search at PrimeFaces showcase;

http://www.primefaces.org/showcase/