Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 2250 invoked from network); 12 Dec 2008 10:46:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 10:46:06 -0000 Received: (qmail 99244 invoked by uid 500); 12 Dec 2008 10:46:17 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 98262 invoked by uid 500); 12 Dec 2008 10:46:15 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 98236 invoked by uid 99); 12 Dec 2008 10:46:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 02:46:15 -0800 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [61.95.162.76] (HELO kecgate02.infosys.com) (61.95.162.76) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 10:45:54 +0000 X-TM-IMSS-Message-ID: <3512fd390000f032@kecgate02.infosys.com> Received: from blrkechub04.ad.infosys.com ([10.66.236.44]) by kecgate02.infosys.com ([61.95.162.76]) with ESMTP (TREND IMSS SMTP Service 7.0; TLS: TLSv1/SSLv3,128bits,RC4-MD5) id 3512fd390000f032 ; Fri, 12 Dec 2008 16:15:35 +0530 Received: from PUNITPHCS01.ad.infosys.com (10.76.151.41) by blrkechub04.ad.infosys.com (10.66.236.44) with Microsoft SMTP Server (TLS) id 8.1.311.2; Fri, 12 Dec 2008 16:15:31 +0530 Received: from PUNITPMBX02.ad.infosys.com ([10.76.151.22]) by PUNITPHCS01.ad.infosys.com ([10.76.151.41]) with mapi; Fri, 12 Dec 2008 16:15:30 +0530 From: Madhav Bhargava To: MyFaces Discussion Date: Fri, 12 Dec 2008 16:15:28 +0530 Subject: RE: Displaying messages over the content - generated by the content? Thread-Topic: Displaying messages over the content - generated by the content? Thread-Index: AclcOtWOYmn99gvPRt2DbQmWwh0JVQABhMIg Message-ID: <0A2898778ACB824D94B19924215C2F8906F3957A60@PUNITPMBX02.ad.infosys.com> References: <28C8A9581EA67B4F8F6B7B5B8DC780CF66802A@S4DE8PSAAQH.t-systems.com> <494216FA.4020509@apache.org> <0A2898778ACB824D94B19924215C2F8906F3957925@PUNITPMBX02.ad.infosys.com> <49422CA2.3070300@apache.org> In-Reply-To: <49422CA2.3070300@apache.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Madhav=20Bhargava=20schrieb: >=20Felix.Becker@t-systems.com=20schrieb: >=20=20=20 >>=20Hi, >> >>=20I've=20got=20a=20JSF=20page=20divided=20in=202=20parts=20-=20the=20s= tatus=20message=20area=20and >>=20the=20content=20area.=20The=20content=20area=20is=20positioned=20und= er=20the=20status >>=20message=20area.=20In=20the=20status=20area=20all=20messages=20for=20= the=20user=20should=20be >>=20shown=20-=20for=20example=20success=20messages,=20error=20messages= =20and=20exceptions. >>=20In=20my=20content=20area=20I've=20got=20a=20>=20value=3D"#{myBean.values}"..>.=20When=20the=20method=20getValues()= =20of=20myBean >>=20throws=20an=20exception,=20I'm=20catching=20this=20exception.=20I=20= want=20to=20display >>=20this=20exception=20in=20the=20status=20message=20area=20-=20but=20th= is=20does=20not=20work=20- >>=20apparently=20because=20the=20status=20area=20is=20already=20rendered= =20when=20the >>=20content=20el-methods=20are=20called.=20Is=20there=20any=20solution= =20for=20this=20problem? >>=20Is=20it=20possible=20to=20render=20the=20status=20area=20at=20last? >> >>=20=20=20=20=20 >=20One=20quick=20solution=20can=20be=20to=20call=20a=20javascript=20func= tion=20on=20onload.=20This=20function=20can=20do=20an=20ajax=20submit=20a= nd=20re-render=20the=20status=20area=20of=20your=20JSP.=20If=20there=20ar= e=20any=20error=20messages=20then=20that=20will=20displayed=20else=20noth= ing=20will=20be=20displayed.=20 >=20If=20you=20want=20more=20control=20then=20do=20not=20add=20the=20Face= sMessage=20to=20the=20FacesContext,=20instead=20handle=20it=20yourself. >=20=20=20 Simon=20wrote: >Will=20re-rendering=20messages=20using=20a=20separate=20ajax=20request= =20work? >FacesMessage=20objects=20are=20attached=20to=20the=20FacesContext,=20not= =20the=20view.=20And >a=20FacesContext=20is=20a=20request-scoped=20object.=20So=20AFAIK,=20a= =20second=20request >will=20always=20see=20an=20empty=20messages=20list... >Regards, >Simon Yes=20you=20are=20right.=20What=20I=20was=20talking=20about=20was=20a=20s= imple=20hack.=20For=20specific=20messages=20like=20the=20ones=20that=20ar= e=20generated=20during=20the=20render=20response=20you=20do=20not=20add= =20it=20to=20the=20FacesContext.=20Instead=20you=20maintain=20them=20into= =20a=20separate=20list=20whose=20scope=20is=20say=20conversation=20scope= =20rather=20than=20a=20request=20scope.=20When=20the=20page=20is=20render= ed,=20onbody=20is=20called=20which=20will=20see=20if=20there=20are=20any= =20messages.=20Component=20like=20t:messages=20will=20inherently=20read= =20from=20FacesContext.=20You=20can=20create=20your=20own=20component=20e= xtending=20say=20t:messages=20and=20read=20from=20a=20different=20source= =20as=20well. ****************=20CAUTION=20-=20Disclaimer=20***************** This=20e-mail=20contains=20PRIVILEGED=20AND=20CONFIDENTIAL=20INFORMATION= =20intended=20solely=20 for=20the=20use=20of=20the=20addressee(s).=20If=20you=20are=20not=20the= =20intended=20recipient,=20please=20 notify=20the=20sender=20by=20e-mail=20and=20delete=20the=20original=20mes= sage.=20Further,=20you=20are=20not=20 to=20copy,=20disclose,=20or=20distribute=20this=20e-mail=20or=20its=20con= tents=20to=20any=20other=20person=20and=20 any=20such=20actions=20are=20unlawful.=20This=20e-mail=20may=20contain=20= viruses.=20Infosys=20has=20taken=20 every=20reasonable=20precaution=20to=20minimize=20this=20risk,=20but=20is= =20not=20liable=20for=20any=20damage=20 you=20may=20sustain=20as=20a=20result=20of=20any=20virus=20in=20this=20e-= mail.=20You=20should=20carry=20out=20your=20 own=20virus=20checks=20before=20opening=20the=20e-mail=20or=20attachment.= =20Infosys=20reserves=20the=20 right=20to=20monitor=20and=20review=20the=20content=20of=20all=20messages= =20sent=20to=20or=20from=20this=20e-mail=20 address.=20Messages=20sent=20to=20or=20from=20this=20e-mail=20address=20m= ay=20be=20stored=20on=20the=20 Infosys=20e-mail=20system. ***INFOSYS********=20End=20of=20Disclaimer=20********INFOSYS***