Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 6658 invoked from network); 8 May 2008 16:10:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 May 2008 16:10:51 -0000 Received: (qmail 5956 invoked by uid 500); 8 May 2008 16:10:41 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 5926 invoked by uid 500); 8 May 2008 16:10:41 -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 5915 invoked by uid 99); 8 May 2008 16:10:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 May 2008 09:10:41 -0700 X-ASF-Spam-Status: No, hits=-0.8 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jak-struts-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 May 2008 16:09:46 +0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Ju8h0-0003HO-4Q for user@struts.apache.org; Thu, 08 May 2008 16:10:02 +0000 Received: from cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com ([99.233.20.4]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 May 2008 16:10:02 +0000 Received: from laurie by cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 May 2008 16:10:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: user@struts.apache.org From: Laurie Harper Subject: Re: html:multibox read but not write Date: Thu, 08 May 2008 12:01:42 -0400 Lines: 184 Message-ID: References: <17100080.post@talk.nabble.com> <17121623.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) In-Reply-To: <17121623.post@talk.nabble.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org user@struts; support@nabble.com would be the customer support channel for the Nabble list browser/forum system. L. houser wrote: > By the way.. to which email address should I post my message using the email > program? > is it: user@struts.apache.org? or support@nabble.com? > > thanks > > > Laurie Harper wrote: >> None of the JSP code made it out of your mail client into the message >> I'm afraid. Try re-posting with your mail program set for plain text >> instead of multipart/mime. >> >> L. >> >> houser wrote: >>> Hi All, >>> >>> I am in very strange situation, and stuck! please help, I have found one >>> thread that much more or less but does not help.. >>> >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >>> >>> I have already use some example and it works.. Now the situation is >>> lsightly >>> different: >>> >>> I have a form: >>> >>> ------------ Start Code ------------ >>> >>> >>> .... FunctionProForm extends ActionForm { >>> private List functionProList = new ArrayList(); >>> >>> ... >>> >>> public List getSelectedPros(FunctionDto fun){ >>> >>> List result = new ArrayList(); >>> for(FunProMap fp : functionProList){ >>> >>> if(fp.getFunction().getName().equals(fun.getName())){ >>> >>> for(int i = 0; i < fp.getSelectedPros().length; i++){ >>> result.add(fp.getSelectedPros()[i]); >>> } >>> return result; >>> } >>> } >>> >>> return result; >>> } >>> } >>> >>> >>> ------ the serializable object FunProMap ------------------ >>> >>> >>> public class FunProMap implements Serializable{ >>> >>> private static final long serialVersionUID = 1L; >>> >>> private FunctionDto function = new FunctionDto(); >>> private List pros = new ArrayList(); >>> private String[] selectedPros = {}; >>> >>> .... >>> } >>> >>> >>> --------------- in JSP: ------------- >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> --------------------- in the SaveAction ---------------------- >>> >>> >>> .... SaveAction extends Action { >>> protected ActionForward doExecute(ActionMapping mapping, >>> ActionForm form, HttpServletRequest request, >>> HttpServletResponse response){ >>> >>> FunctionProForm myForm = (FunctionProForm) form; >>> ... >>> >>> List functions = myService.listFunctions(); >>> >>> for(FunctionDto fun : functions){ >>> >>> fun.setPros(myForm.getSelectedPros(fun)); >>> >>> myService.updateFunction(fun); >>> } >>> .... >>> return mapping.findForward("success"); >>> } >>> } >>> >>> >>> ------------ End Code ------------ >>> >>> The check boxes are populated correctly from the database, i.e. for each >>> FUnction, the corresponding checkbos is checked according to the list of >>> available Pros (function.pros). >>> >>> The problem is that if I edit these boxes, check and uncheck, and click >>> the >>> Submit button, the changed is not saved to the database. >>> >>> I have run the debug and find that the method myForm.getSelectedPros(fun) >>> returns the old values but not the new checked-unchecked boxes' values >>> :-( >>> !! >>> >>> I have used with a simple form according to: >>> >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> http://www.jguru.com/faq/view.jsp?EID=925277 >>> >>> >>> MyForm extends ActionForm { >>> List myList; >>> String[] selectedValues; >>> // .... >>> } >>> >>> >>> and >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> and this works fine.. >>> >>> Please help... >>> >>> ruga >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> For additional commands, e-mail: user-help@struts.apache.org >> >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org