[jboss-user] [JBoss Seam] - End conversation and h:message
DiegoCoronel
do-not-reply at jboss.com
Wed Dec 19 17:11:18 EST 2007
Hi, im trying to show a message in my xhtml.
| <?xml version="1.0" encoding="ISO-8859-1"?>
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:rich="http://richfaces.org/rich"
| xmlns:a4j="http://richfaces.org/a4j"
| xmlns:fpf="http://www.fpf.br/jsf"
| template="/layout/layout.xhtml">
| <ui:define name="content">
| <h:form>
| <fpf:titlePanel title="#{msgCadastroFornecedores.INCLUSAO}" />
| <a4j:outputPanel id="msg">
| <fpf:messages />
| </a4j:outputPanel>
| <s:validateAll>
| <!-- FIELDS -->
| <fpf:input id="nomeFantasia" required="true" fieldName="#{msgCadastroFornecedores.TX_NOME_FANTASIA}" entity="#{cadastroFornecedoresBean.fornecedor.txNomeFantasia}" size="50" />
| <fpf:input id="razaoSocial" required="true" fieldName="#{msgCadastroFornecedores.TX_RAZAO_SOCIAL}" entity="#{cadastroFornecedoresBean.fornecedor.txRazaoSocial}" size="50" />
| <fpf:input id="telefone" fieldName="#{msgCadastroFornecedores.TX_TELEFONE}" entity="#{cadastroFornecedoresBean.fornecedor.txTelefones}" size="50" />
| <fpf:input id="fax" fieldName="#{msgCadastroFornecedores.TX_FAX}" entity="#{cadastroFornecedoresBean.fornecedor.txFax}" size="50" />
| <fpf:input id="mail" fieldName="#{msgCadastroFornecedores.TX_EMAIL}" entity="#{cadastroFornecedoresBean.fornecedor.txEmail}" size="50" />
| <fpf:input id="endereco" fieldName="#{msgCadastroFornecedores.TX_ENDERECO}" entity="#{cadastroFornecedoresBean.fornecedor.txEndereco}" size="50" />
| <fpf:input id="pessoaContato" fieldName="#{msgCadastroFornecedores.TX_CONTATO}" entity="#{cadastroFornecedoresBean.fornecedor.txPessoaContato}" size="50" />
| <fpf:input id="observacao" fieldName="#{msgCadastroFornecedores.TX_OBSERVACAO}" entity="#{cadastroFornecedoresBean.fornecedor.txObservacao}" size="50" />
| </s:validateAll>
| <rich:spacer height="5px" />
|
| <!-- BUTTONS -->
| <table>
| <tr>
| <td>
| <a4j:commandLink action="#{cadastroFornecedoresBean.save}" reRender="msg" styleClass="commandLinkStyle">
| <fpf:button id="searchButton" labelButton="#{msg.BT_SALVAR}"/>
| </a4j:commandLink>
| </td>
| <td>
| <h:commandLink action="#{cadastroFornecedoresBean.actionCancel}" immediate="true" styleClass="commandLinkStyle" >
| <fpf:button id="cancelButton" labelButton="#{msg.BT_CANCELAR}"/>
| </h:commandLink>
| </td>
| </tr>
| </table>
|
| </h:form>
| </ui:define>
| </ui:composition>
|
|
my managedBean, just essential
| @Name("cadastroFornecedoresBean")
| @Scope(ScopeType.CONVERSATION)
| public class CadastroFornecedoresBean {
|
| /**
| * Chamada da classe para auxiliar nas mensagens de comfirmação e erro.
| */
| @In
| private FacesMessages facesMessages;
|
| public String merge() {
| almoxarifadoFacade.mergeFornecedor(fornecedor);
| facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, "#{msg.SUCESSO}");
| return "sucesso";
| }
|
| .
| .
| .
|
my page xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <page xmlns="http://jboss.com/products/seam/pages"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
| login-required="false">
|
| <navigation from-action="#{cadastroFornecedoresBean.merge}">
| <rule if-outcome="sucesso">
| <end-conversation before-redirect="true"/>
| <redirect view-id="/face/almoxarifado/cadastro_fornecedores/pesquisar.seam">
| <message severity="INFO">Operacao com Sucesso</message>
| </redirect>
|
| </rule>
| </navigation>
|
| <navigation from-action="#{cadastroFornecedoresBean.actionCancel}">
| <rule if-outcome="cancel">
| <redirect view-id="/face/almoxarifado/cadastro_fornecedores/pesquisar.seam"/>
| </rule>
| </navigation>
|
| </page>
|
and the code in my xhtml i want the message show
| <h:messages globalOnly="true" fatalClass="faltalMessage"
| errorClass="errorMessage" warnClass="warningMessage" infoClass="infoMessage" id="generalMessages" />
|
my problem is the message not showing.. anyone can help me ?
ty, and sry about english
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114415#4114415
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114415
More information about the jboss-user
mailing list