JSF - Problema utilizando rich:modalPanel

0 respostas
F

Pessoal,
estou com um problema ao utilizar o rich:modalPanel.
Fiz um exemplo simples, onde em uma tela tem um botão, este botão chama um panel modal, neste panel modal tem um h:inputText ligado ao bean. E tem um botão que imprime o valor digitado no h:inputText, que está no bean.
O problema é que não está imprindo o valor digitado no h:inputText, entra no método, imprime “Imprimiu”, mas o valor digitado na descrição não é impresso.
Alguém sabe o que estou fazendo de errado?

Estou utilizando utilizando a versão do richfaces 3.2.0.

Segue abaixo o .jsp e o managed bean.

testemodal.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
	<h:form id="form">
		<a
			href="javascript:Richfaces.showModalPanel('testemodal',{heigth:300 ,width:400, top:25})">Abrir</a>
		<rich:modalPanel id="testemodal">
			<f:facet name="header">
				<h:panelGroup>
					<h:outputText value="Teste Modal"></h:outputText>
				</h:panelGroup>
			</f:facet>
			<f:facet name="controls">
				<h:graphicImage value="image/close.png"
					onclick="Richfaces.hideModalPanel('testemodal')" />
			</f:facet>
			<rich:panel id="testemod">
				<h:inputText value="#{testeModal.descricao}" />
			</rich:panel>
			<rich:panel id="botoes">
				<a4j:commandButton value="Imprimir" reRender="testemod"
					action="#{testeModal.imprimir}" rendered="true" />
			</rich:panel>
		</rich:modalPanel>
	</h:form>
</f:view>
</body>
</html>

TesteModal.java

public class TesteModal {

	private String descricao = new String();

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public void imprimir() {
		System.out.println("Imprimiu");
		System.out.println(descricao);
	}

}
Criado 28 de maio de 2008
Respostas 0
Participantes 1