Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 2333 invoked from network); 27 May 2008 09:42:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 May 2008 09:42:38 -0000 Received: (qmail 59326 invoked by uid 500); 27 May 2008 09:42:36 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 59289 invoked by uid 500); 27 May 2008 09:42:35 -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 59278 invoked by uid 99); 27 May 2008 09:42:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2008 02:42:35 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 May 2008 09:41:41 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1K0vgw-0006zE-Ue for users@myfaces.apache.org; Tue, 27 May 2008 02:42:02 -0700 Message-ID: <17486778.post@talk.nabble.com> Date: Tue, 27 May 2008 02:42:02 -0700 (PDT) From: Jan Ziegler To: users@myfaces.apache.org Subject: Re: inputHidden is not rendered correctly on immediate action In-Reply-To: <17486716.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: ziegler@top21.de References: <17486716.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I forgot my environment: MyFaces 1.23 Facelets 1.0.14 Richfaces 3.21=20 Tomcat 6.0.16 Jan Ziegler wrote: >=20 > Hi, >=20 > I have a problem with h:inputHidden. I want to use it for keeping a > request scope bean=C2=B4s value from one request to another. The followin= g code > shows a simple example: >=20 > > =20 > > > =09=09=09 > > >=20 > > > =09 is the text value" /> > >=20 > >
> =09=09=09 >
>=20 >=20 > So I got 2 commandButtons: One ("set data reload") for setting > "formBean.textValue" with an f:setPropertyActionListener and one ("simple > reload") for just reloading the page (to check if the value get restored)= . > I want "formBean.textValue" to be kept over the request. In every case a > get back on the same page (no actions are invoked)=20 >=20 > For restoring the value, I use a h:inputHidden ("field_restore") which is > bound the request scoped bean ("formBean.textValue").=20 >=20 > So the scenario is like this: > 1) Press "set data reload"=20 > 2) check the output: the textValue is set and the h:outputText shows it > 3) Press "simple reload" > 4) check the output: the textValue is restored and the h:outputText shows > it >=20 > Everthing works as expected when I set immediate of ("set data > reload")-commandButton to FALSE.=20 > The value ist set and the output shows it. On a "simple reload" the value > is restored an the output shows it again. If I look at the generated html > code the hidden input-field is rendered with the textValue like this: >=20 > id=3D"j_id110:field_restore"/> >=20 > Now if I change the immediate-Flag to TRUE (which is necessary in my case > to bypass some other validations) the behavior is like this: > After pressing the "set data reload"-commandButton the value is set and > the output shows it (like above). But now on the following "simple reload= " > the value gets lost!=20 >=20 > Therefor I checked the hidden-input field after pressing "set data reload= " > and found the reason for not restoring the value - the hidden-input is > rendered like this: >=20 > id=3D"j_id110:field_restore"/> >=20 > As you can see the value-Attribut is empty and therefor, nothing will be > restored in the next (simple) request. The strange thing is, that after > pressing "set data reload" the textValue on the bean is set and the > h:output shows the correct value, but only the hidden-field > value-Attribute misses it. >=20 > I can use t:saveState which solves the problem but I think in this > situation it should really work by using h:inputHidden. >=20 > Why is it not working with immediate set to true? When I debug the > lifecyle I can see that the f:setPropertyActionListener for setting > formBean.textValue is fired (in APPLY_REQUEST_PHASE instead of > INVOKE_APPLIATION which is ok for immediate actions) and therefor the bea= n > value is set correctly (which I can see on the output) but why is the > value of the hidden field not rendered with this value? =20 >=20 > Thanx for any help / hints, > jan ziegler >=20 >=20 >=20 --=20 View this message in context: http://www.nabble.com/inputHidden-is-not-rend= ered-correctly-on-immediate-action-tp17486716p17486778.html Sent from the MyFaces - Users mailing list archive at Nabble.com.