From adffaces-user-return-2214-apmail-incubator-adffaces-user-archive=incubator.apache.org@incubator.apache.org Tue Feb 20 22:42:57 2007 Return-Path: Delivered-To: apmail-incubator-adffaces-user-archive@locus.apache.org Received: (qmail 64932 invoked from network); 20 Feb 2007 22:42:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2007 22:42:57 -0000 Received: (qmail 24606 invoked by uid 500); 20 Feb 2007 22:43:04 -0000 Delivered-To: apmail-incubator-adffaces-user-archive@incubator.apache.org Received: (qmail 24584 invoked by uid 500); 20 Feb 2007 22:43:04 -0000 Mailing-List: contact adffaces-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: adffaces-user@incubator.apache.org Delivered-To: mailing list adffaces-user@incubator.apache.org Received: (qmail 24575 invoked by uid 99); 20 Feb 2007 22:43:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 14:43:04 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of chris.lowe.uk@gmail.com designates 209.85.132.244 as permitted sender) Received: from [209.85.132.244] (HELO an-out-0708.google.com) (209.85.132.244) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 14:42:54 -0800 Received: by an-out-0708.google.com with SMTP id b2so486068ana for ; Tue, 20 Feb 2007 14:42:33 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Kl8WpBceyN6gt2GpqTmWYEJugnni2OydMfWhgbj4AU37gckB1CvwyA/OZD9t34fwsU9ox3le3sCwgB8qTKDNEg6BdL4H0nBm4ayjCmq97bZJw9SMxzZBWP2QnhVpzokRiMhz5kItXY0bxhoXBRM0A0DFi2CFCfMcl+HeLX/FPxU= Received: by 10.114.93.1 with SMTP id q1mr3542682wab.1172011353058; Tue, 20 Feb 2007 14:42:33 -0800 (PST) Received: by 10.114.210.7 with HTTP; Tue, 20 Feb 2007 14:42:33 -0800 (PST) Message-ID: Date: Tue, 20 Feb 2007 22:42:33 +0000 From: "Chris Lowe" To: adffaces-user@incubator.apache.org Subject: Re: tr:messages with detailed message In-Reply-To: <200702191210190865.006B8CDF@project-team.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_46702_17110404.1172011353022" References: <200702191210190865.006B8CDF@project-team.de> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_46702_17110404.1172011353022 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thomas, I'd also be interested in any information on this. I've found myself using the following phase listener to hack around situation by setting the message summary to the value for the detail. I know, I know - it ain't pretty but I'd rather some design smell rather than just showing "Value required" at the global message () level. Regards, Chris. import java.util.Iterator; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext ; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; public class MessageCustomisationListener implements PhaseListener { public MessageCustomisationListener() { } public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } public void beforePhase(final PhaseEvent phaseEvent) { final FacesContext context = phaseEvent.getFacesContext(); final Iterator itr = context.getClientIdsWithMessages(); if (!itr.hasNext()) { // no messages, so nothing to do return; } final UIViewRoot uiViewRoot = context.getViewRoot(); while (itr.hasNext()) { final String clientId = (String) itr.next(); if (clientId == null) { continue; } final UIComponent component = uiViewRoot.findComponent (clientId); if (component == null) { // If a session times out while a message is being thrown, a component // will be returned as null if the user attempts to interact with the // app. return; } final Iterator itr2 = context.getMessages(clientId); while (itr2.hasNext()) { final FacesMessage msg = (FacesMessage) itr2.next(); msg.setSummary(msg.getDetail()); } } } public void afterPhase(PhaseEvent e) { } } On 19/02/07, Thomas Hamacher wrote: > > Hi @all, > > does anyone know, why the messages given through the > requiredMessage=""-attribute does not show up with the detailed message > text, but only the standard-short version when showing them through the > -tag, but only near the input-field? Is there any option I > can set or is this simply not supported? I think it is a little bit > confusing, when the messages, displayed through tr:messages are different > than the error-messages near the field. > > Any help would be greately appriciated. > > Thanks so far > Thomas > > ------=_Part_46702_17110404.1172011353022--