1
how do I put a background image in primefaces
. I’ve tried some shapes but none worked out. The closest to a good result I arrived was using <p:graphicImage/>
but when I minimize a menu or do a table search the image does not follow the rest of the layout.
Look at that:
This is my template:
<h:body>
<p:layout fullPage="true">
<p:layoutUnit header="Sistema de Auditorias" position="north"
resizable="false" closable="false" collapsible="false">
<p:toolbar style="height:39px;">
<f:facet name="left">
<p:outputLabel value="Diego Augusto"
style="position: relative;left: 1360px;" />
<p:commandButton value="Sair"
style="height:28px;width:90px; text-align:center;position: relative;left: 1370px;" />
</f:facet>
</p:toolbar>
</p:layoutUnit>
<p:layoutUnit header="Desenvolvido por: TI Unimed Norte Pioneiro"
position="south" resizable="false" closable="false"
collapsible="false">
</p:layoutUnit>
<p:layoutUnit header="Menu Inicial" size="200" position="west"
resizable="false" closable="false" collapsible="false">
<h:form>
<p:panelMenu
style="background-image: url('../images/verdeBrasil.png');">
<p:submenu label="Arquivo">
<p:menuitem value="Página Principal"
outcome="/pages/principal.xhtml" />
<p:menuitem value="Sobre" />
<p:menuitem value="Sair" />
</p:submenu>
<p:submenu label="Auditorias">
<p:menuitem value="Todos Procedimentos"
outcome="/pages/solicitacoesGeral.xhtml" />
</p:submenu>
<p:submenu label="Relatórios"></p:submenu>
</p:panelMenu>
</h:form>
</p:layoutUnit>
<p:layoutUnit position="east" size="400" header="Sobre a Auditoria"
style="text-align:center;" resizable="false" closable="false "
collapsible="true" effect="drop">
</p:layoutUnit>
<p:layoutUnit position="center" resizable="false" closable="false"
collapsible="false">
<ui:insert name="conteudo" />
<h:panelGrid>
<p:graphicImage styleClass="ladoDir.css"
style="height: 73px; width: 900px;" url="/images/verdeBrasil.png" />
</h:panelGrid>
</p:layoutUnit>
</p:layout>
I tried to do that: style="background-image: url('../images/verdeBrasil.png');"
at the beginning of <p:panelMenu>
but it didn’t work either.
No 404 error when you used this style?
– Maicon Carraro
No. Sometimes it does not appear. Or sometimes it appears very little only a few edges. I think it is because it is under everything.
– DiegoAugusto
already tried to put in the form?
– Maicon Carraro
In the top example when I use the panelMenu does not change anything
– DiegoAugusto
The top image is made by a <p:graphicImage>
– DiegoAugusto
already yes, it was only a few gaps with the image.
– DiegoAugusto