struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Hunter" <ihun...@hunterweb.net>
Subject Re: Dynamic select menu
Date Mon, 05 May 2003 13:41:39 GMT
Try using html:options instead, much easier

----- Original Message -----
From: "Manuel Lenz" <LzM@viessmann.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Monday, May 05, 2003 9:37 AM
Subject: Dynamic select menu



Hi to all,
I´d like to generate a select menu.
First I do an select to db. The result is stored in an vector.
All the values are Strings.
The Values get displayed on the console, but not put into the option-tag.

Here is the code:

----------------------------------------------------------------------------
-----------------------------------------
<html:select property="swg" size="" value="">

            <%
                  try
                  {

                        Enumeration elem = schluesselForm.getV_swg
().elements();

                        while (elem.hasMoreElements())
                        {
                              schluesselForm.setSwg((String)
elem.nextElement());
                              System.out.println ("Test (70): " +
schluesselForm.getSwg());
            %>
            <html:option value="<% schluesselForm.getSwg(); %>">
            <%
                        schluesselForm.getSwg();
            %>
            </html:option>
            <%
                        } //end while
                  } //end try

                  catch(Exception e)
                  {
                        System.out.println("Fehler in schluessel.jsp (83):
" + e.getMessage());
                  }
                        %>
            </html:select>
----------------------------------------------------------------------------
-------------------------------------------

Has anybody an idea why it doesn´t work?

Manuel





---------------------------------------------------------------------
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


Mime
View raw message