Duvida <P:layout>
10/08/2011
0
Ola a todos, tudo bem ?
Estou com uma pequena duvida, creio que simples em usar prime faces com jsf 2.0fiz uma pagina usando p:layout com dois p:layoutUnit, um para ficar o menu e outro para exibir as paginas que forem escolhidas no menu.O problema é que eu não estou entendendo como fazer isto, segui um exemplo na internet usando iframe mas num ta dando muito certo. Será que alguém poderia me ajudar, tô bem cru neste framework mas to tentando aprender, seguem os codigos para analise, Todas as sugestões são bem vindas!
abaixo estou tentando abrir a pagina cadastro.xhtml na pagina index.xhtml, ate abre mas nao aparece os componentes do prime.
INDEX.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:p="http://primefaces.prime.com.tr/ui" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" > <h:head> <title>Facelet Title</title> </h:head> <h:body> <p:layout fullPage="true" > <p:layoutUnit position="left" width="200" header="Menu" resizable="true" collapsible="true" > <h:form id="form_menu"> <h:commandButton value="cadastro" action="cadastro" /> <p:menu> <p:menuitem url="cadastro.xhtml" value="cadastro" target="centro"/> </p:menu> </h:form> </p:layoutUnit> <p:layoutUnit position="center" header=" Sitema De teste "> <iframe name="centro" width="100%" height="100%"> </iframe> </p:layoutUnit> <p:layoutUnit position="bottom" height="100" resizable="true" collapsible="true" > </p:layoutUnit > </p:layout> </h:body></html>
<?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:p="http://primefaces.prime.com.tr/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>exemplo de aplicação jsf 2.0 </title> </h:head> <h:body> <h:form id="frmCadastro"> <table> <tr> <td>Nome:</td> <td> <p:inputText id="nome" value="#{clienteBean.cliente.nome}" required="true"/> </td> </tr> <tr> <td>Data Nascimento:</td> <td> <p:calendar id="dataNasc" value="#{clienteBean.cliente.dataNascimento}"/> </td> </tr> <tr> <td>Sexo:</td> <td> <h:selectOneMenu value="#{clienteBean.cliente.sexo}"> <f:selectItems value="#{clienteBean.listaSexo}" var="sexo" itemLabel="#" itemValue="#"/> </h:selectOneMenu> </td> </tr> <tr> <td>Cidade:</td> <td> <p:inputText id="cidade" value="#{clienteBean.cliente.localidadeCliente.cidade}" required="true"/> </td> </tr> <tr> <td>Estado:</td> <td> <p:inputText id="estado" value="#{clienteBean.cliente.localidadeCliente.estado}" required="true"/> </td> </tr> </table> <p:message for="nome"/> <p:message for="dataNasc"/> <p:message for="cidade"/> <p:message for="estado"/> <br/> <h:commandButton value="Cadastrar" action="confirmacao"/> <h:commandButton value="Cancelar" immediate="true" action="#{clienteBean.cancelar}"/> </h:form> </h:body></html>
Perdoem a ignorância!
Silas Sena
Posts
11/08/2011
Luciano Martins
TEMPLATE.XHTML <p:layout fullPage="true" id="formularioPrincipal"> <p:layoutUnit position="top" height="80" header="Studio Pilates CorpoAlma" closable="true" collapsible="true"> <h:outputText style="text-align:right" value="Usuário logado: #{loginBean.usuario.funcionario.nome}"/> </p:layoutUnit> <p:layoutUnit position="left" width="220" header="Menu" closable="true" collapsible="true" scrollable="true"> <ui:include src="menuEsquerdo.xhtml" /> </p:layoutUnit> <ui:insert name="conteudo" /> <p:layoutUnit position="bottom" height="33" header="Luciano Martins - zicadopv@gmail.com" closable="true" collapsible="true"> </p:layoutUnit> </p:layout> PRINCIPAL.XHTML <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.prime.com.tr/ui" template="/formularios/template.xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <ui:define name="conteudo"> <p:layoutUnit position="center"> <p:graphicImage value="/images/logoStudio.png" /> <ui:insert name="conteudo" /> </p:layoutUnit> </ui:define></ui:composition>
17/08/2011
Dyego Carmo
Resolvido ?
Se sim , favor fechar o chamado !
Obrigado !
19/08/2011
Silas Sena
09/09/2011
Dyego Carmo
Conseguiste ? Caso positivo , por favor poderia fechar o chamado ?
Obrigado !
Clique aqui para fazer login e interagir na Comunidade :)