Return-Path: Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: (qmail 31163 invoked from network); 13 Apr 2011 08:30:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Apr 2011 08:30:55 -0000 Received: (qmail 15172 invoked by uid 500); 13 Apr 2011 08:30:54 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 15142 invoked by uid 500); 13 Apr 2011 08:30:54 -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 15126 invoked by uid 99); 13 Apr 2011 08:30:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2011 08:30:52 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of admirolaz@gmail.com designates 74.125.82.181 as permitted sender) Received: from [74.125.82.181] (HELO mail-wy0-f181.google.com) (74.125.82.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Apr 2011 08:30:45 +0000 Received: by wyi11 with SMTP id 11so334880wyi.12 for ; Wed, 13 Apr 2011 01:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=zKqnqOIHgVoVs2cosiy/BXOyanu2ftLpMZnRkuVrz9U=; b=xPqvKu7F5diKCz/3cStXIj49iBiDDTlnGNVk4+QygcGIq8i0hjQKhragY5KBgc/A7j zM0BZvJjcifUcsOKsjLSySQsHK7SG4AVgXkSNha/qfe0Hn/kLcZi8RLw+aBkcMJbS6sX q/ehf340x2c4J07YEWaSzqePxGfftYyK5Fup8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=EMdatCiZYTnKOHUStjgjcZYFFjWm2+Cr18Q3T7oK6l1TRiHgGi419CpEzXsp6Q2Hws TOZGn8aEBL2iXutAc5uHkAXnSqfb8Vw1urZEqnrnFFffTFYf2NOpObF8NX/hqOPihGn9 x5aIMW9kPNzXl9meqVVEU8pw2ow8RGbtifp/8= Received: by 10.227.195.129 with SMTP id ec1mr540335wbb.180.1302683423896; Wed, 13 Apr 2011 01:30:23 -0700 (PDT) Received: from [192.168.0.5] (lan160-726.elekta.lt [217.77.26.160]) by mx.google.com with ESMTPS id b20sm176011wbb.50.2011.04.13.01.30.22 (version=SSLv3 cipher=OTHER); Wed, 13 Apr 2011 01:30:23 -0700 (PDT) Message-ID: <4DA55F1D.2080600@gmail.com> Date: Wed, 13 Apr 2011 11:30:21 +0300 From: Admirolas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; lt; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: MyFaces Discussion Subject: Re: [trinidad 1.2] table rows not populated References: <4DA55676.2080404@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Other field's is input fields. They are submitted by form. Table isn't input. It is not submit'ed. So after request, request scoped bean i recreated, and input field's is submitted. Here you can read about lifecicle of JSF: http://www.ibm.com/developerworks/library/j-jsf2/ You just have to store list in another scope (session, or some custom, like pageFlowScope) Admirolas 2011.04.13 11:20, Me Self rašė: > Its requestScope. I know the bean is recreated for every request > however the input fields will be repopulated from the page form before > the action method is called. I have other input fields in the form > that I didnt show in the code snippets and they work as expected - its > only the table thats not being repopulated. > > > > On Wed, Apr 13, 2011 at 9:53 AM, Admirolas wrote: >> What scope of PageBean is? If it is Request scoped, then it should work like >> this. After every request bean is rebuilt. You should move bean to Session >> scope or Trinidad's pageFlowScope (Read Developer Guide). >> Admirolas >> >> 2011.04.13 10:01, Me Self rašė: >>> I have a with an "add row" button but whenever the user >>> presses a in that table then the list thats backing >>> up the table is reset. All other fields in the managed bean are >>> repopulated as expected. >>> >>> The managed bean is request scoped: >>> >>> public class PageBean { >>> private List dtoList = new ArrayList(); >>> >>> public String addRow() { >>> dtoLists.add(new Dto("", "")); >>> return ""; >>> } >>> ... >>> } >>> >>> The page is built using facelets 1.1.4: >>> >>> >>> >>> >> var="dto"> >>> >>> >> action="#{pageBean.addRow}" >>> value="addrow" /> >>> >>> >>> >>> >>> >>> >>> >>> ... >>> >>> >>> If I change the managed bean to be session scoped then the list is not >>> lost between postbacks. But how do I make it work with request scope? >>