2016-04-04 5 views
0

Grundsätzlich versuche ich auf einer Anmeldeseite für meine App zu arbeiten. Ich bin fast fertig, aber das Fenster ist scrollbar und die panelBox (siehe Login-Quellcode unten) befindet sich ganz links im Fenster. Ich dachte, es in die Mitte zu setzen würde das Problem lösen, aber es tat es nicht. Wie ein aus dem Fenster von Scrollen und Zentrieren der panelBoxwie zentrieren und verhindern Login von scrollen

diese
<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE html> 
<f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> 
    <af:document title="LoginPage.jsf" id="d1"> 
     <af:form id="f1" inlineStyle="background-color:#c3de2f;" defaultCommand="b1"> 
      <af:panelStretchLayout id="psl1" dimensionsFrom="children" startWidth="100" endWidth="100" topHeight="200" 
            bottomHeight="500"> 
       <f:facet name="bottom"> 
        <af:spacer width="10" height="100" id="s1"/> 
       </f:facet> 
       <f:facet name="center"> 
        <af:panelBox text="Hi!" id="pb1" showDisclosure="false" background="light" 
           type="stretch" 
           immediate="true" inlineStyle="background-color:#c3de2f;"> 
         <af:outputText value="Testing" id="ot1" 
             inlineStyle="font-size:x-large; font-weight:bolder;"/> 
         <af:panelFormLayout id="pfl1" 
              inlineStyle="background-image:none; "> 
          <f:facet name="footer"> 
           <af:button id="b1" action="#{loginBean.Login.doLogin}" 
              icon="resources/images/button.png"/> 
           <af:message id="m1" 
              message="see admin for assistance"/> 
          </f:facet> 
          <af:outputText value="enter username and password" id="ot2" 
              inlineStyle="font-style:italic; font-weight:bold; font-size:small;"/> 
          <af:inputText label="Username:" id="it1" 
              value="#{loginBean.Login.username}"/> 
          <af:inputText label="Password:" id="it2" 
              value="#{loginBean.Login.password}" 
              secret="true" showRequired="true"/> 
         </af:panelFormLayout> 
        </af:panelBox> 
       </f:facet> 
       <f:facet name="start"/> 
       <f:facet name="end"/> 
       <f:facet name="top"> 
        <af:panelGridLayout id="pgl2"> 
         <af:gridRow height="auto" id="gr1"> 
          <af:gridCell width="100%" id="gc1"> 
           <af:image source="/resources/images/logo.png" id="i1"/> 
          </af:gridCell> 
         </af:gridRow> 
        </af:panelGridLayout> 
       </f:facet> 
      </af:panelStretchLayout> 
     </af:form> 
    </af:document> 
</f:view> 

Antwort

0

Versuchen Sie verhindern können, Sie Dies wird

helfen
<?xml version='1.0' encoding='UTF-8'?> 
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> 
    <jsp:directive.page contentType="text/html;charset=UTF-8"/> 
    <f:view> 
    <af:document id="d1" title="Login Page"> 
     <af:form id="f1" defaultCommand="#{'pgTplt:cbLogin'}"> 
      <af:panelStretchLayout id="psl1" startWidth="33%" endWidth="33%" 
            topHeight="33%" bottomHeight="33%"> 
       <f:facet name="center"> 
       <af:panelGroupLayout id="pgl1" layout="vertical" 
            halign="center"> 
        <af:panelFormLayout id="pflLogin" rows="2" maxColumns="1"> 
        <af:inputText id="itUsername" label="Username" 
            value="#{Login.username}"/> 
        <af:inputText label="Password" id="itPassword" secret="true" 
            value="#{Login.password}"/> 
        <af:spacer width="10" height="10" id="s1"/> 
        <af:commandButton text="Login" id="cbLogin" 
             actionListener="#{Login.doLogin}"/> 
        </af:panelFormLayout> 
       </af:panelGroupLayout> 
       </f:facet> 
       <f:facet name="bottom"> 
       <af:panelGroupLayout id="pgl2"/> 
       </f:facet> 
       <f:facet name="top"> 
       <af:panelGroupLayout id="pgl3"/> 
       </f:facet> 
      </af:panelStretchLayout> 
     </af:form> 
    </af:document> 
    </f:view> 
</jsp:root> 
0

sehr einfach.

In PanelStretch Layout-, Ändern Sie den bottomHeight = "100" Wert, 500 wirklich hoch ist. Halten Sie es weniger. Wenn Sie die Höhe von bottomHeight erhöhen, wird die Option zum Blättern automatisch hinzugefügt.

Verwandte Themen