Boa Tarde,
Eu to com uma zica com o primefaces :
Minha tela inicial eh composto por um h:panelGrid e dentro dele eu possuo diversos botoes que vai abrir na propria pagina as funcionalidades(sem necessidade de refresh), conforme codigo abaixo:
home.xhtml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
</f:facet>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/css/style.css" />
<ui:insert name="head"></ui:insert>
</h:head>
<h:panelGrid border="0" cellpadding="0" cellspacing="0" columns="4"
width="100%" headerClass="header">
<f:facet name="header">
<ui:include src="menu.xhtml" />
</f:facet>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setdiadog}">
<p:graphicImage
value="/html/images/http-__iconesbr.oficinadanet.com_8133_128x128.png" />
<br />
<h:outputText value="Configuração De Usuários" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setTags}">
<p:graphicImage value="/html/images/hashtag.png" />
<br />
<h:outputText value="TAGs" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setSecoes}">
<p:graphicImage
value="/html/images/http-__iconesbr.oficinadanet.com_8080_128x128.png" />
<br />
<h:outputText value="Seções" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setParagrafos}">
<p:graphicImage
value="/html/images/http-__iconesbr.oficinadanet.com_8125_128x128.png" />
<br />
<h:outputText value="Paragrafos" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column> </h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setTemplates}">
<p:graphicImage
value="/html/images/http___iconesbr.oficinadanet.com_82955_128x128.png" />
<br />
<h:outputText value="Templates" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setInformacoes}">
<p:graphicImage
value="/html/images/http-__iconesbr.oficinadanet.com_81544_128x128.png" />
<br />
<h:outputText value="Informações" />
</p:commandLink>
</p:panel> </center>
</h:column>
<h:column>
<center> <p:panel style="width: 145px; height:148px"
styleClass="linkk">
<p:commandLink style="text-decoration: none" ajax="false"
action="#{PrimeTestBean.setGerarDocs}" >
<p:graphicImage
value="/html/images/icone-some-pdf-to-word-converter-world-windows.png" />
<br />
<h:outputText value="Gerar Documentos" />
</p:commandLink>
</p:panel> </center>
</h:column>
</h:panelGrid>
</f:view>
</html>
ate ai tudo bem, contudo eu preciso fazer com que o botao “Gerar documentos” abra um dialog nessa propria tela…
eu tentei fazer da seguinte forma:
<p:commandLink style="text-decoration: none" ajax="false"
onclick"geradoc.show()" >
e abaixo de </h:panelGrid> eu adicionei o dialog :
<p:dialog id="dialoggeradoc" widgetVar="geradoc" showEffect="clip"
hideEffect="clip" modal="true" resizable="false">
<f:facet name="header">
<h:outputText value="Gerar Documento" style="font-size: 14px" />
</f:facet>
<table>
<tr>
<td>
<h:outputLabel for="nomearquivo" value="Nome do Arquivo:" />
</td>
<td>
<p:inputText id="nomearquivo" required="true"
label="nomearquivo" styleClass="form1" />
</td>
</tr>
<tr>
<td>
<h:outputLabel for="tipoarquivo" value="Tipo de Arquivo:" />
</td>
<td>
<p:autoComplete id="tipoarquivo" dropdown="true"
style="width: 30px;height:30px;" />
</td>
</tr>
<tr>
<td>
<h:outputLabel for="selecttempate" value="Template:" />
</td>
<td>
<p:autoComplete id="selecttempate" dropdown="true"
style="width: 30px;height:30px;" />
</td>
</tr>
<tr>
<td>
<h:outputLabel for="informacao" value="Informações:" />
</td>
<td>
<p:autoComplete id="informacao" dropdown="true"
style="width: 30px;height:30px;" />
<p:spacer width="10" height="10" />
<p:commandButton image="ui-icon-plusthick"
style="width: 30px;height:30px;" type="button" />
<p:spacer width="10" height="10" />
<p:commandButton image="ui-icon ui-icon-close" title="Delete"
style="width: 30px;height:30px;" />
</td>
</tr>
<tr>
<td colspan="2">
<br /> <br/>
<p:panel header="Informações Faltantes">
<h:outputLabel for="tagfaltante" value="#....#" />
<p:inputText id="tagfaltante" required="true"
style="width: 400px;" />
</p:panel>
</td>
</tr>
<tr>
<td colspan="2"><p:spacer width="40%" height="10" />
<p:commandButton value="Gerar" style="font-size: 12px" />
<p:spacer width="10" height="10" />
<p:commandButton value="Cancelar" style="font-size: 12px" />
</td>
</tr>
</table>
</p:dialog>
contudo, os outros links para de funcionar e o meu dialog nem abre.
Alguem sabe o que eu to fazendo de errado?
to desconfiado que seja o servelet que eu fiz que ta zeado …
segue a estrutura:
principal.xhtml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
</f:facet>
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/resources/css/style.css" />
<ui:insert name="head"></ui:insert>
</h:head>
<ui:composition template="template.xhtml">
<ui:define name="conteudo">
<h:form>
<h:panelGrid columns="1" width="100%">
<p:outputPanel autoUpdate="true" id="outputPanelConteudo">
<ui:include src="#{PrimeTestBean.include}" />
</p:outputPanel>
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>
</f:view>
</html>
template.xhtml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.prime.com.tr/ui">
<f:view contentType="text/html">
<h:head>
<f:facet name="first">
<meta http-equiv="X-UA-Compatible" content="EmulateIE8" />
<meta content='text/html; charset=UTF-8' http-equiv="Content-Type" />
</f:facet>
<title>DSC - Principal</title>
<style>
.linkk {
cursor: pointer;
}
.header {
text-align: left;
}
</style>
<ui:insert name="head"></ui:insert>
<link rel="shortcut icon" href="favicon.ico"
type="image/vnd.microsoft.icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</h:head>
<h:body>
<p:panel>
<f:facet name="header">
<div style="float: left;">
<h:outputText value="Sistema Gerador Documentos" />
</div>
<div style="float: right; position: relative; top: -5px">
<p:graphicImage value="/html/images/1316528794_logout.png"
styleClass="linkk" title="Click para Deslogar" />
</div>
<div style="float: right; position: relative; top: -3px;">
<p:graphicImage value="/html/images/help.png" styleClass="linkk"
title="Click para obter ajuda" />
</div>
</f:facet>
<f:facet name="footer">
<center> <h:outputText style="font-size: 11px"
value="© 2011 DSC Todos os Direitos Reservados" /> </center>
</f:facet>
<ui:insert name="conteudo" />
</p:panel>
</h:body>
</f:view>
</html>
Ta correto a forma que to usando ?