Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 38677 invoked from network); 3 Sep 2007 15:45:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2007 15:45:50 -0000 Received: (qmail 77030 invoked by uid 500); 3 Sep 2007 15:45:42 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 76994 invoked by uid 500); 3 Sep 2007 15:45:42 -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 76983 invoked by uid 99); 3 Sep 2007 15:45:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 08:45:42 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bernhard.huemer@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Sep 2007 15:45:36 +0000 Received: by nf-out-0910.google.com with SMTP id b2so1357872nfb for ; Mon, 03 Sep 2007 08:45:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=ZXMzxKJm1ukrn+PXOVK7UqVxhkqBrusNqAM5KxPrRA0H13e9/WzLZ2aVbBdNzIZX7VjtEILGMbmyD9PFeIB4ztfbiYfn3ecOnF1BZqUqpqFFDCZyqBTR8Cb8+gJshLlQn6IJoL87dSR2pvJd5+jsJmh7IwO8EMDgIgxCTVsJELY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=k7lmyxn8GfBkH0SIkVP54hh4jrGnI+cpsZU3oROUJNAR0EpLL4iMAyKCgprGjH6m+8wiOl0Y3nSL75q+62zGTS4Ig46wKtXvROIuwPsqNZ8IJobOVRCP8HWHDxdD4fkDnqmxE1qpjKS5+KPaxaeMBlB0PNAjdAk3eBxZZAXElDE= Received: by 10.86.79.19 with SMTP id c19mr3523277fgb.1188834314955; Mon, 03 Sep 2007 08:45:14 -0700 (PDT) Received: from ?192.168.1.2? ( [62.47.36.97]) by mx.google.com with ESMTPS id k29sm6191530fkk.2007.09.03.08.45.12 (version=SSLv3 cipher=RC4-MD5); Mon, 03 Sep 2007 08:45:13 -0700 (PDT) Message-ID: <46DC2C07.3040109@gmail.com> Date: Mon, 03 Sep 2007 17:45:11 +0200 From: Bernhard Huemer User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: MyFaces Discussion Subject: Re: Events are fired twice for unknown reasons References: <12402953.post@talk.nabble.com> <46D6B1AA.7060300@gmail.com> <12462673.post@talk.nabble.com> In-Reply-To: <12462673.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello, You could use Facelets as it doesn't use the JSP TagHandler classes of MyFaces, though I haven't tried yet. At least I can't remember facing this issue when using Facelets. By the way, here is the bug report: http://issues.apache.org/jira/browse/MYFACES-1712 regards, Bernhard Fan Shao wrote: > Thanks Bernhard, > > from a user's view, what's the impact to JSF applications of this issue? And > in what cases this problem can be reproduced? Is there anyway that I can > mitigate it if brings about any problem before this issue is fixed? > > > > Fan > > > > Bernhard Huemer-2 wrote: > >> Hello, >> >> I've encountered the same problem recently and I've also figured out the >> reason. It's because the method setProperties() is called twice. Usually >> you wouldn't notice this behaviour as most properties just will be >> overridden but that's not the case for a ValueChangeListener (or an >> ActionListener). For a better understanding of this issue, I'll describe >> the call hierachy (somewhat simplified): >> >> /// >> // >> myfaces/core/branches/1_2_1/api/javax/faces/webapp/UIComponentClassicTagBase.java >> >> protected UIComponent findComponent(FacesContext context) >> { >> // ... >> // around line 1097 >> >> _componentInstance = findComponent(parent,id); >> if (_componentInstance == null) >> { >> _componentInstance = createComponent(context, id); >> _created = true; >> setProperties(_componentInstance); // << here is the >> "first" call >> // .... >> >> \\\ >> >> /// >> // >> myfaces/core/branches/1_2_1/api/javax/faces/webapp/UIComponentELTag.java >> >> protected UIComponent createComponent(FacesContext context, String newId) >> { >> // ... >> // around line 98 >> >> component.setId(newId); >> setProperties(component); // << her is the "second" call (it's >> actually the first, but it's the one I would omit) >> >> return component; >> } >> >> \\\ >> >> I'll create a JIRA issue (including the appropriate patch) in a few >> hours, or maybe anyone else might be taking a look in the meantime. >> >> regards, >> Bernhard >> >> Fan Shao wrote: >> >>> Hi, >>> >>> When trying to trace down the problem I posted a few days ago >>> (http://www.nabble.com/Button-must-be-clicked-once-before-it-could-actually-do-something-tf4297733.html#a12234990) >>> I found some of the events are fired twice, where they are supposed to be >>> fired only once. >>> >>> The screen contains a datatable, and a dropdown box. When the user >>> selects a >>> value of the dropdown box, the form is submitted using >>> this.form.submit(), >>> and the datatable is reloaded according to user's selection. Everytime >>> the >>> datatable is reloaded its associated handler is called twice. >>> >>> Anyone has any idea about this? >>> >>> Many thanks! >>> >>> Fan >>>