Zuerst mal die Seiten die die Probleme machen:
template.xhtml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<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:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns
="http://primefaces.org/ui">
<f:view contentType="text/html">
<h:head>
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title><ui:insert name="title"/> - TWiBu 1.0, © by TWi 2012</title>
<style type="text/css">
.ui-corner-all {
border: 0 solid #000;
}
.ui-widget-header {
text-align: center;
}
.ui-layout-center .twibu-layout-center {
text-align: center !important;
}
</style>
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
Header
</p:layoutUnit>
<p:layoutUnit position="south" size="100" closable="true" collapsible="true">
Footer
</p:layoutUnit>
<p:layoutUnit position="west" size="175" collapsible="false">
Menu
</p:layoutUnit>
<p:layoutUnit position="center" styleClass="twibu-layout-center">
<ui:insert name="content"/>
</p:layoutUnit>
</p:layout>
</h:body>
</f:view>
</html>[/XML]
login.xhtml
[XML]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns
="http://primefaces.org/ui">
<body>
<ui:composition template="/template.xhtml">
<ui:define name="title">
<h
utputText value="Login"/>
</ui:define>
<ui:define name="content">
<form method="POST" action="j_security_check">
<p
anelGrid columns="2">
<f:facet name="header">
<h
utputLabel value="Bitte Userid und Passwort eingeben"/>
</f:facet>
<p
utputLabel value="Username:" for="j_username"/>
<p:inputText id="j_username"/>
<p
utputLabel value="Password:" for="j_password"/>
<p
assword id="j_password"/>
<f:facet name="footer">
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" type="submit">
<span class="ui-button-text">Login</span>
</button>
</f:facet>
</p
anelGrid>
</form>
</ui:define>
</ui:composition>
</body>
</html>[/XML]
In dem CSS-Teil in der template.xhtml habe ich folgende Kombinationen versucht:
- .ui-layout-center .twibu-layout-center
- .ui-layout-unit-content .twibu-layout-center
- .ui-widget-content .twibu-layout-center
- .twibu-layout-center
Aber nie wird der Inhalt des Center-Layouts zentriert.
Fant: Ja, es ist gelöst aber mit <center></center>. Wenn es da eine andere Möglichkeit gäbe faände ich das schon besser.
F.S.WhiTeY: Leider eben nicht.
Grüße,
Willi