myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angel Miralles Arevalo <anmiral...@yahoo.es>
Subject Re: Messages on JSF Site are shown twice
Date Tue, 02 Oct 2007 11:02:49 GMT
Try with this:

jsp code:
   
<h:messages globalOnly="true" showDetail="true" showSummary="false" styleClass="hcenter
mensaje_alerta" />

Bean code:

// Add message in case of error
ResourceBundle resource = ResourceBundle.getBundle("servidesk.messages.MessageResources");
FacesMessage message = MessageUtils.getMessage(resource, "info.ko.grabar.grupo", null);
getFacesContext().addMessage(null, message);

Note than I read from a properties file: "servidesk.messages.MessageResources"


----- Mensaje original ----
De: Andreas Heidrich <Andreas.Heidrich@toyota-fs.com>
Para: MyFaces Discussion <users@myfaces.apache.org>
Enviado: martes, 2 de octubre, 2007 11:43:51
Asunto: Messages on JSF Site are shown twice


Hello,
we are working on our first JSF Implementation at the moment. So forgive me
if this is a stupid question ;-)

We show all error messages in a single area on the page like this:

            <t:div styleClass="errors"
                  rendered="#{customerWebController.notValid}">
                  <f:verbatim>
                        <h5>Folgende Fehler sind aufgetreten:</h5>
                  </f:verbatim>
                  <t:messages showDetail="true" />
            </t:div>

In the code, we add some messages with the FacesContext addMessage
mechanism like this:

                        FacesContext.getCurrentInstance().addMessage(null,

MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, "zipCodeNotValid",
null));
                        return "error";

however, at runtime, the givem error mesage is always displayed twice.

Any idea ?

Thanx
Andreas



Andreas Heidrich                         (Embedded
Organisationsprogrammierer/EDV Orga      image moved
Toyota Kreditbank GmbH                   to file:
Tel: +49-2234-102-1963|Fax:              pic06224.gif)
+49-2234-102-99-1963
Email: andreas.heidrich@toyota-fs.com




-------------------------------------------------------------------
Toyota Financial Services ist eine Marke der TOYOTA Kreditbank GmbH
Lexus Financial Services ist eine Marke der TOYOTA Kreditbank GmbH
TOYOTA Kreditbank GmbH
Toyota-Allee 5, Köln-Marsdorf
www.toyota-bank.de www.lexus-finance.de
Sitz der Gesellschaft: Köln - Amtsgericht Köln - HRB 18068
Ust-IdNr.: DE 811425043 - Steuernummer: 223/5819/0038
Vorsitzender des Beirates: Keji Sudo
Geschäftsführer: Peter Pollhammer - Andreas Bullock - Christian Ruben
WestLB - Konto 1846 - BLZ 300 500 00
-------------------------------------------------------------------
Toyota Financial Services ist eine Marke der TOYOTA Leasing GmbH
Lexus Financial Services ist eine Marke der TOYOTA Leasing GmbH
TOYOTA Leasing GmbH
Toyota-Allee 5, Köln-Marsdorf
www.toyota-bank.de www.lexus-finance.de
Sitz der Gesellschaft: Köln - Amtsgericht Köln - HRB 20031
Ust-IdNr.: DE 811425051 - Steuernummer: 223/5819/0038
Vorsitzender des Beirates: Keji Sudo
Geschäftsführer: Peter Pollhammer - Tadashi Ueda - Christian Ruben
WestLB - Konto 4667663 - BLZ 300 500 00
-------------------------------------------------------------------

Toyota Financial Services (UK) PLC, Company Registration Number
02299961, Great Burgh, Burgh Heath, Epsom, Surrey, KT18 5UZ,
registered in England.

Lexus Financial Services and Redline Finance are trading styles
of Toyota Financial Services (UK) PLC.

Authorised and regulated by the Financial Services Authority.
This correspondence is for the intended recipient only. It may
contain confidential or legally privileged information or both.
No confidentiality or privilege is waived or lost by any
mistransmission or unauthorised alteration during transmission.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. If you receive
this correspondence in error, please immediately delete it from
your system and notify the sender. Any views expressed in this
message are those of the individual sender, except where the
sender expressly, and with authority, states them to be the views
of Toyota. This message has been checked for viruses but the
recipient is strongly advised to rescan the message before
opening any attachments or attached executable files.


       
____________________________________________________________________________________
Sé un Mejor Amante del Cine                         
¿Quieres saber cómo? ¡Deja que otras personas te ayuden!
http://advision.webevents.yahoo.com/reto/entretenimiento.html
Mime
View raw message