Erro com Dialog do primefaces

2 respostas
C

Boa tarde, estou tentando migrar para JSF2, usando JBoss 5, Eclipse Helios, Hibernate, ainda aprendendo ok, rsrsrs, bom o fato é que minha página teste carrega os grupos tudo ok, usando os componentes do primefaces 2.1, tenho o seguinte problema, o dialog abre corretamente, carrega os dados tudo, porém ele bloqueia tudo, não permite alterar o registro, acho que estou errando nas tags:

Grupos.xhtml

Template.xhtml

Obs.: Notei que quando altero a tag <h:form id=“formGru”> antes da <p:dialog header=“Cadastro de grupos” widgetVar=“dialogGrupos”
resizable=“false” modal=“true” showEffect=“slide” width=“500”> ele libera para alterar, porém não carrega o registro correto, sempre carrega o anterior!

Alguém notou algum erro de tags, enfim podem me auxiliar?

Obrigado

Abraços

César

2 Respostas

J

Cara conseguiu resolver o problema? Estou enfrentando esse mesmo problema na minha aplicação.

C

Amigo desculpe por tanto tempo né, é que são tantos erros que desisti um pouco do Java, bom o código ficou assim:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition template="cadastro.xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:rich="http://richfaces.org/rich">
	<ui:define name="principal">
		<head>
		<title>Manutenção de Cadastro dos Grupos</title>
		<link
			href="#{facesContext.externalContext.requestContextPath}/skin.css"
			rel="stylesheet" type="text/css" />
		<p:resources />
		</head>
		<body>
		<f:view>
			<p:layout fullPage="true">
				<p:layoutUnit position="left" width="200" header="Atividades"
					resizable="true" closable="true" collapsible="true">
					<h:form prependId="false">
						<p:commandLink value="Novo Grupo"
							action="#{grupoMB.novoGrupo}" update="infoGrupo"
							oncomplete="dialogGrupos.show()" />
					</h:form>
				</p:layoutUnit>
				<p:layoutUnit position="center">
					<h1>Cadastro dos Grupos dos Produtos</h1>
					<br />
					<h:form prependId="false">
						<p:dataTable id="tabela" var="grupo" value="#{grupoMB.grupos}"
							paginator="true" rows="8">
							<p:column>
								<f:facet name="header">
									<h:outputText value="Código" />
								</f:facet>
								<h:outputText value="#{grupo.id}" />
							</p:column>
							<p:column>
								<f:facet name="header">
									<h:outputText value="Nome" />
								</f:facet>
								<h:outputText value="#{grupo.nome}" />
							</p:column>
							<p:column>
								<f:facet name="header">
									<h:outputText value="Alterar" />
								</f:facet>
								<p:commandButton action="#{grupoMB.editarGrupo}"
									value="Alterar" update="infoGrupo"
									oncomplete="dialogGrupos.show()" />
							</p:column>
							<p:column>
								<f:facet name="header">
									<h:outputText value="Excluir" />
								</f:facet>
								<p:commandButton action="#{grupoMB.excluirGrupo}"
									value="Excluir" update="infoGrupo" />
							</p:column>
						</p:dataTable>
					</h:form>
				</p:layoutUnit>
			</p:layout>

			<p:dialog header="Cadastro do Grupo" widgetVar="dialogGrupos"
				resizable="false" modal="true" showEffect="slide" width="500">
				<h:form prependId="false">
					<h:panelGrid id="infoGrupo" columns="2" style="margin-bottom:10px">

						<h:outputLabel for="titulo" value="Nome:" />
						<h:inputText id="titulo" value="#{grupoMB.grupo.nome}" />

						<p:commandButton update="tabela" oncomplete="dialogGrupos.hide();"
							action="#{grupoMB.salvarGrupo}" value="Confirmar" />
						<p:commandButton update="tabela" oncomplete="dialogGrupos.hide();"
							value="Fechar" />

					</h:panelGrid>
				</h:form>
			</p:dialog>

		</f:view>
		</body>
	</ui:define>
</ui:composition>

Assim funcionou!

t+

Criado 18 de novembro de 2010
Ultima resposta 10 de mar. de 2011
Respostas 2
Participantes 2