<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:f="http://xmlns.jcp.org/jsf/core"  xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <!--@elvariable id="msgs" type="de.ivu.elect.business.lokalisierung.control.LokalisierungResourceBundle"-->

	<h:form id="frmMainMenu">
		<f:attribute name="role" value="presentation" />
		<p:menubar id="mainMenu" model="#{mainMenu.menuModel}" autoDisplay="false" >
            <c:if test="#{mainMenuSearch.mainMenuSearchEnabled}">
            <f:facet name="options">
                <p:outputPanel styleClass="ui-autocomplete-mit-button">
                    <p:autoComplete id="inMenuAutoComplete" forceSelection="false"
                            title="#{msgs['menu.autocomplete.title']}" value="#{mainMenuSearch.entry}"
                            maxlength="256"
                            completeMethod="#{mainMenuSearch.onComplete}" queryDelay="50" minQueryLength="1"
                            onkeyup="var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) {PF('sucheMenu').jq.click(); return false;}"
                            styleClass="ui-autocomplete--kompakt"
                             />
                    <p:watermark for="inMenuAutoComplete"
                            value="#{msgs['menu.autocomplete.watermark']}"/>

                    <p:commandButton id="btnMenuAutoComplete" action="#{mainMenuSearch.select}"
                            icon="#{icons.iconSearch}" widgetVar="sucheMenu" styleClass="ui-autocomplete-button ui-autocomplete-button--kompakt"/>

                    <p:hotkey bind="ctrl+shift+m" handler="document.getElementById('frmMainMenu:inMenuAutoComplete_input').focus();"  />
                </p:outputPanel>
            </f:facet>
            </c:if>
		</p:menubar>
        <p:hotkey bind="ctrl+shift+s" handler="document.getElementById('frmMainMenu:inMenuAutoComplete_input').focus();" rendered="#{mainMenu.rendered}" />
	</h:form>
</ui:composition>