From user-return-219248-archive-asf-public=cust-asf.ponee.io@struts.apache.org Sat Feb 2 04:04:20 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D6423180627 for ; Sat, 2 Feb 2019 05:04:19 +0100 (CET) Received: (qmail 61013 invoked by uid 500); 2 Feb 2019 04:04:13 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 60987 invoked by uid 99); 2 Feb 2019 04:04:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Feb 2019 04:04:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D3899C834D for ; Sat, 2 Feb 2019 04:04:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.999 X-Spam-Level: * X-Spam-Status: No, score=1.999 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id XNQLdAUNyiz0 for ; Sat, 2 Feb 2019 04:04:08 +0000 (UTC) Received: from mail.nqadmin.com (mail.nqadmin.com [12.230.133.169]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 5C3B760D93 for ; Sat, 2 Feb 2019 03:55:51 +0000 (UTC) Received: (from root@localhost) by mail.nqadmin.com (8.14.7/8.14.7) id x123td2P022279; Fri, 1 Feb 2019 21:55:39 -0600 Received: from SAMSUNG-SM-G930A (ip174-73-124-27.br.br.cox.net [174.73.124.27]) (authenticated-user ppasala) (TLSv1/SSLv3 AES128-GCM-SHA256 128/128) by mail.nqadmin.com with SMTP id 2stw3dqxgxh35kn33m2iqjgmy2; Fri, 01 Feb 2019 21:55:39 -0600 (CST) (envelope-from dbadmin@pangburngroup.com) X-Avenger: version=0.8.5; receiver=mail.nqadmin.com; client-ip=174.73.124.27; client-port=48833; syn-fingerprint=65535:49:1:60:M1460,S,T,N,W8; network-path=12.230.133.161 12.94.168.177 12.122.162.86 12.122.156.197 12.122.117.121 0.0.0.0 0.0.0.0 4.7.200.14 68.1.1.229 70.169.88.97 70.169.88.97; network-path-time=1549079739 Date: Fri, 01 Feb 2019 21:55:13 -0600 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----LFM79JW5O7P9XFK4D9POFJFIIQB4XA" Content-Transfer-Encoding: 7bit Subject: Re: Struts2 Checkboxlist To: Struts Users Mailing List , Arjuna Bandara From: Prasanth Message-ID: <49BAFB9D-BCEA-4564-906F-6D6E2745F70F@pangburngroup.com> ------LFM79JW5O7P9XFK4D9POFJFIIQB4XA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable The data class holding the array is in session, done using the scope interc= eptor=2E Thanks Prasanth On February 1, 2019 9:30:30 PM CST, Arjuna Bandara wrote: >Hi, > >As I understand, you need to modify previous Array before saving=2E > >Have you tried Session variable ? > >Regards > >Arjuna > >On Sat, 2 Feb 2019 3:18 am Prasanth, wrote: > >> Hi, >> >> I am using a checkboxlist on a jsp page which corresponds to a >ArrayList >> in the form class, which is used to store form data from a multi page >> wizard=2E I am using scope interceptor to store the form >> class in session so that the data persists as the user navigates the >> wizard=2E When the user selects some check boxes it is correctly >populated in >> the form class but if the user navigates back in the >> wizard and unchecks the check box (non of the check boxes selected) >struts >> doesn't set the ArrayList to empty=2E It will still contain the old >> selection=2E What is the best way to solve this issue? >> >> My Options: >> 1=2E Should I use Preparable and set this ArrayList to empty? Since >this is >> a wizard (multiple pages submitting to the same action) have to make >sure >> it is done only when submitting the page that have >> these checkboxes=2E >> 2=2E Create two separate ArrayLists, one to get values from Struts and >> another to save the original selection and clear the first array >list=2E Down >> side is I need to populate the list linked to the form >> when user navigates back to that page=2E >> >> Neither of them seem elegant=2E Is there a way to make struts set the >> ArrayList to empty when user doesn't select any check box? >> >> Using Struts 2=2E3=2E35 >> >> Thanks, >> Prasanth >> ------LFM79JW5O7P9XFK4D9POFJFIIQB4XA--