To get round this all u have to do is have

    Option[] myOpts = { 
      new Option("opt1").addElement("opt1"),
      new Option("opt2").addElement("opt1"),
      new Option("opt3").addElement("opt1")
    };

which I think is better


-----Original Message-----
From: George Armhold [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 06, 2000 2:53 PM
To: ECS
Subject: bug in Option implementation, ECS v1.3.3


Adding Option elements to a Select seems to not produce functioning
form selections.  Example:

    Form form = new Form(myURL, Form.get);

    Option[] myOpts = { 
      new Option("opt1"),
      new Option("opt2"),
      new Option("opt3")
    };
    
    form.addElement("Select Option: ");
    form.addElement(new Select("opts", myOpts));

This will produce HTML like:

    Select Option: 
    <select name="opts">
        <option value="opt1">
        <option value="opt2">
        <option value="opt3">
    </select>

My understanding is that it SHOULD produce HTML like this:

    Select Option: 
    <select name="opts">
        <option value="opt1">opt1
        <option value="opt2">opt2
        <option value="opt3">opt3
    </select>


Without the "optN" text after the <option> tags, the page renders an
empty selection list on both NS and IE.  If I replace the Option
objects with simple Strings, it does the right thing.  Unfortunately I
need to use the Option object so that I can set an explicit default
selection.

Thanks for your attention.


--
George Armhold
Rutgers University
Bioinformatics Initiative


--
------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]


--
------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to