1
Good colleagues, I’m having trouble with the Megamenu component of primefaces I’d like the components to be visible to users but they’re hidden behind the central region, so I’d like to bring it forward. How can I do that? I tried using external css and calling more unfortunately didn’t work so I decided to use inline css as well. Below I leave images
Menu code
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:form>
<h3
style="font-size: 1.3em; margin: 0; margin-left: 2%; font-weight: 1.5; padding: 5px;"
align="center">Administrador</h3>
<p:menu style="border:none; width:95%;">
<p:menuitem icon="ui-icon-check" value="Estoque de produtos"
outcome="/pages/productos.xhtml" />
<p:menuitem icon="ui-icon-person" value="Funcionários"
outcome="/pages/funcionarios.xhtml" />
<p:menuitem icon="ui-icon-tag" value="Departamentos"
outcome="/pages/departamentos.xhtml" />
</p:menu>
<p:megaMenu orientation="#{MBIncludesBean.orientation}"
style="border:none;">
<p:submenu label=" Consultar ações">
<p:column>
<p:submenu label="Consultar Historiais">
<p:menuitem value="Historial de entradas"
outcome="/pages/entradaProductos.xhtml" />
<p:menuitem value="Historial de saídas"
outcome="/pages/saidaProductos.xhtml" />
<p:menuitem value="Historial de requisições"
outcome="/pages/requisicoes.xhtml" />
<p:menuitem value="Historial de produtos"
outcome="/pages/historialProducto.xhtml" />
<p:menuitem value="Historial de departamentos"
outcome="/pages/historialDepartamento.xhtml" />
<p:menuitem value="Historial de funcionários"
outcome="/pages/historialFuncionario.xhtml" />
</p:submenu>
</p:column>
</p:submenu>
</p:megaMenu>
</h:form>
</ui:composition>
css code
@charset "ISO-8859-1";
.ui-layout-west {
z-index: 20 !important;
overflow: visible !important;;
}
.ui-widget, .ui-widget .ui-widget {
font-size: 95% !important;
}
.ui-layout-west .ui-layout-unit-content {
overflow: visible !important;
}
layout code
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><ui:insert name="namePage">Layout do sistema</ui:insert></title>
<h:outputStylesheet library="css" name="style.css"/>
</h:head>
<h:body style="background: #f2f1f1;">
<p:growl id="msg" life="6000" />
<p:layout fullPage="true" style="border:none;">
<p:layoutUnit position="west" size="245" style="border:none;" >
<ui:insert name="menu" />
</p:layoutUnit>
<p:layoutUnit size="60" position="north" style="border:none; overflow:visible;">
<ui:insert name="cabecalho" />
</p:layoutUnit>
<p:layoutUnit position="center" style="border:none; ">
<ui:insert name="conteudo" />
</p:layoutUnit>
</p:layout>
</h:body>
</html>
without code is kind of hard to help. Put the xhtml of your page there.
– Adriano Gomes
Without HTML and CSS code it is difficult to give you an accurate answer, but you can put a z-index:100 for example in your menu to see if it solves.
– hugocsl
put Z-index:100 and not solved but already added the menu code and css
– Ayrton Pereira
From what I’ve seen your problem is with the structure of "html", the menu is inside a container that has a certain width and the menu does not expand beyond the width of that container... have to think of a way to adjust this but will probably change the structure of the order of the tags etc, If you want and nobody to present a definitive solution I can assemble a very simple model for you to understand the concept and the idea of the layout organization, ai vc apply in your
– hugocsl
Maybe, it would be a help for me @hugocsl, I just added the code of the project layout
– Ayrton Pereira