I am using a template file to my all pages.I have a dialog box in one of my page. But when the dialog box is popup, It will go under the template header.
I have deal with Z-INDEX ,but it's not fixed for any z-index. Here is my codes.
myPage.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
template="template.xhtml">
<ui:define name="content">
<div style="text-align: center;"></div>
<style type="text/css">
.imagebox a {
margin-left: 10px;
}
.ui-tree {
width: auto!important;
}
</style>
<h:form id="galary" style="">
<div style="float: left;width: 80%;margin-left: 2%;margin-top:2%; position: relative;">
<p:dataGrid var="image" value="#{Gallery.images}" columns="8" layout="grid" paginator="true" id="cars"
style="margin: auto;" rows="24"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="6,12,16">
<p:commandLink update=":testDialog" action="#{Gallery.selectImage(image)}" type="button"
oncomplete="PF('dlg1').show();">
<p:panel style="text-align:center">
<p:graphicImage value="#{request.contextPath}/gal_img_thumb/#{image}" width="100"
height="100"/>
</p:panel>
</p:commandLink>
</p:dataGrid>
</div>
</h:form>
<p:dialog style="position: absolute; z-index: 101!important;" header="Basic Dialog" widgetVar="dlg1" minHeight="40">
<h:form id="cnf">
<p:graphicImage value="https://www.gstatic.com/webp/gallery3/1.sm.png" />
</h:form>
</p:dialog>
</ui:define>
myTemplate.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
<meta http-equiv="PRAGMA" content="NO-CACHE"/>
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/>
<meta http-equiv="EXPIRES" content="0"/>
<link rel="icon"
type="image/png"/>
<title>myWebApplication</title>
</f:facet>
<style type="text/css">
.ui-layout-north{z-index: 100!important;}
</style>
</h:head>
<h:body style="font-size: 70%;width: 80%!important;">
<p:layout fullPage="true" resizeTitle="resize">
<p:layoutUnit position="north" size="150" id="north">
<ui:include src="header.xhtml"/>
</p:layoutUnit>
<p:layoutUnit position="center" >
<ui:insert name="content" >
</ui:insert>
</p:layoutUnit>
<p:layoutUnit position="south" size="21" style="padding:0;">
<h:outputText value="This is footer" styleClass="copyrigth"/>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
Update:
If I remove important mark from .ui-layout-north{z-index: 100!important;} line in the template file, the issue will fix, but the dropdown is going under the page.
Please help me to solve this. Note - I cannot add big changes to the template file,because that template is using some other pages.
Thanks in advance.