Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 54335 invoked from network); 18 Nov 2003 08:18:48 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Nov 2003 08:18:48 -0000 Received: (qmail 31700 invoked by uid 500); 18 Nov 2003 08:18:08 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 31605 invoked by uid 500); 18 Nov 2003 08:18:08 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 31592 invoked from network); 18 Nov 2003 08:18:07 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 18 Nov 2003 08:18:07 -0000 Received: (qmail 54052 invoked from network); 18 Nov 2003 08:18:12 -0000 Received: from unknown (HELO RSI-PUN-MAIL01.indussoft.rsystems.com) (202.140.134.62) by minotaur-2.apache.org with SMTP; 18 Nov 2003 08:18:12 -0000 Received: from rsipunabhim ([10.1.1.42] unverified) by RSI-PUN-MAIL01.indussoft.rsystems.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 18 Nov 2003 13:47:42 +0530 Message-ID: <006501c3adac$acdf6e90$2a01010a@rsipunabhim> Reply-To: "Abhijeet Mahalkar" From: "Abhijeet Mahalkar" To: "Struts Users Mailing List" References: <02b901c3ad91$04f2f3c0$6401a8c0@what> Subject: Re: Generate a Drop-Down ??? Date: Tue, 18 Nov 2003 13:49:20 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-OriginalArrivalTime: 18 Nov 2003 08:17:42.0238 (UTC) FILETIME=[700CE7E0:01C3ADAC] X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N rather than putting it into session keep it in pageContext object ... pageContext.setAttribute("produtoView", formatosArquivos); this works definitely... rest is ok.. hope this may help you... regards abhijeet ----- Original Message ----- From: "Bryan Hanks" To: Sent: Tuesday, November 18, 2003 10:31 AM Subject: RE: Generate a Drop-Down ??? There's a very easy way to generate a drop-down. From your example, I'm not sure what ProdutoView does, so I'm going to assume you want to only create a drop-down of "CSV" and "XML". Forgive me for starting over, but there is a very easy way to do what you want, but you must modify you ArrayList a bit. In the action: ArrayList formatosArquivos = new ArrayList(); formatosArquivos.add( new org.apache.struts.util.LabelValueBean( "CSV", "20" ) ); formatosArquivos.add( new org.apache.struts.util.LabelValueBean( "XML", "40" ) ); session.setAttribute("produtoView", formatosArquivos); --- In the JSP: --- Explanation: Org.apache.struts.util.LabelValueBean takes two arguments: label, value. These are assigned as "label" and "value", respectively (obvious, no?). When the JSP runs html:options, it creates a drop-down with labels labelProperty (="label") and corresponding values property (="value"). The selected value is returned in the html:select property (="product_value"). In this example, if the user selects "CSV", then product_value=20. See also: http://masterdev.dyndns.dk/dev/6.htm Cheers, Bryan -----Original Message----- From: Mauricio T. Ferraz [mailto:mauricio.tavares@cilix.com.br] Sent: Friday, November 14, 2003 5:23 PM To: Struts Users Mailing List Subject: Generate a Drop-Down ??? I put the bean on the method execute on myAction ArrayList formatosArquivos = new ArrayList(); formatosArquivos.add("CSV"); formatosArquivos.add("XML"); formatosArquivos.add("Algorithmics"); ProdutoView produto = new ProdutoView(); produto.setFormatosArquivos(formatosArquivos); session.setAttribute("produtoView",produto); So, How I generate a drop-down list on the next Jsp page??? --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org