2016-04-04 17 views
0

Temel olarak uygulamanız için bir giriş sayfası üzerinde çalışıyorum. Neredeyse bitti, ama pencere kaydırılabilir ve panelBox (aşağıdaki giriş kaynak koduna bakın) pencerenin en solunda. Merkeze koymanın sorunu çözeceğini düşünmüştüm ama yapmadı. kaydırma gelen pencereyi engellemek ve panelBoxKaydırarak oturum açmayı ve merkezlemeyi nasıl engeller

<?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> 

cevap

0

bu deneyin ortalayabilmek bir Nasıl, bu size çok basit

<?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

yardımcı olacaktır.

PanelStretch Düzeni yılında 500 gerçekten yüksek, bottomHeight = "100" değeri değiştirin. Daha az tut. BottomHeight'ı artırırsanız, sayfa kaydırma seçeneğini otomatik olarak ekler.

İlgili konular