Centralizar Edits RichFaces + JSF?

4 respostas
juniorsatanas

Pessoal o RichFaces deixa meus campos de login em cima no canto direito… não estou conseguindo fazer ele ficarem no centro… pois tudo e definido pelo rich…
Como se faz isso ? via css ?

segue meu códgio:

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="rich" uri="http://richfaces.ajax4jsf.org/rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>RichFaces</title>
        <script type="text/javascript">
        function validar( form )
        {
            if( document.forms['FORM'].elements['FORM:email'].value == "" ||
                document.forms['FORM'].elements['FORM:senha'].value == "" )
                {
                    Richfaces.showModalPanel('mp',{width:450, top:200});
                    return false;
                }

            return true;
         }
        </script>
    </head>
    <body>
        <f:view>
           <h:form id="FORM" onsubmit="return validar( this );">
               <fieldset>
               <h:outputText value="Digite : e senha:" />

           <h:panelGrid columns="2">

               <h:outputLabel value="Email : " />
               <h:inputText id="email" value="#{pessoaMB.pessoa.email}" styleClass="inputLogin">
               <f:validator validatorId="emailValidator" />
               <a4j:support event="onkeyup" reRender="ajaxText"/>
	       </h:inputText>


               <h:outputLabel value="Senha : " />
               <h:inputSecret id="senha" value="#{pessoaMB.pessoa.senha}" styleClass="edit" validatorMessage="A senha deve ter no mínimo 6 caracteres!" />

               <h:commandButton type="submit" value="OK" action="#{pessoaMB.login}" />
               <h:commandButton type="reset" value="Limpar" />

           </h:panelGrid>

           <rich:modalPanel id="mp" minHeight="300" minWidth="900"
                    height="300" width="900" zindex="2000">
                    <f:facet name="header">
                            <h:outputText value="Preencha os campos por favor!" />
                    </f:facet>
                    <f:verbatim>
                                <center>
                                Por favor, preencha todos os campos!
                                <br/><br/><br/><br/>
                            <a >Fechar Janela</a>
                                &lt;/center&gt;
                            &lt;/f:verbatim&gt;
            &lt;/rich:modalPanel&gt;
&lt;/fieldset&gt;
           &lt;/h:form&gt;
        &lt;/f:view&gt;
    &lt;/body&gt;
&lt;/html&gt;

4 Respostas

D

tente utilizar os campos que você quer centralizar dentro da tag <div align=“center”>…

juniorsatanas

não deu :

http://lh5.ggpht.com/_nTzBoYSeT2I/S2HDHch2suI/AAAAAAAADbE/khehR_n6-po/s720/div.png

devilmachine

Cara Esperimenta fazer assim…

<h:form>

<h:panelGrid styleClass="rsPanel" width="300" columns="3"  columnClasses="scriptdemocolumn-l,scriptdemocolumn-r" style="width:auto " >
              <h:outputText styleClass="rsLabel" value="Codigo" />
              <h:outputText styleClass="rsLabel" value="Nr° Sequencia" />
              <h:outputText styleClass="rsLabel" value="Tipo de Isençao" />

                <h:inputText  styleClass="rsInput"  value="#{userBean.codigo}" />                    
                <h:inputText  styleClass="rsInput"  value="#{userBean.nr_seq}" />                   
                <h:inputText  styleClass="rsInput"  value="#{userBean.descri}" />

          </h:panelGrid>

é 1 exemplo que fiz aqui… assim tera 3 colunas… cadas linha em baixo do seu campo…
pra vc colocar 1 na frente do outro fica + - assim

<h:form>

<h:panelGrid styleClass="rsPanel" width="300" columns="3"  columnClasses="scriptdemocolumn-l,scriptdemocolumn-r" style="width:auto " >
              <h:outputText styleClass="rsLabel" value="Codigo" /> <h:inputText  styleClass="rsInput"  value="#{userBean.codigo}" />     
              <h:outputText styleClass="rsLabel" value="Nr° Sequencia" /> <h:inputText  styleClass="rsInput"  value="#{userBean.nr_seq}" />     
              <h:outputText styleClass="rsLabel" value="Tipo de Isençao" />   <h:inputText  styleClass="rsInput"  value="#{userBean.descri}" />

ficaria assim

</h:panelGrid>
juniorsatanas

valeu mano vou testar aqui !

Criado 28 de janeiro de 2010
Ultima resposta 19 de abr. de 2010
Respostas 4
Participantes 3