It's been a really long time since i looked at that code and I don't have it
immediatly available. The following will do what you want although a little
redundant.
Form form = new Form(myURL, Form.get);
Option[] myOpts = {
new Option("opt1").addElement("opt1"),
new Option("opt2").addElement("opt2"),
new Option("opt3").addElement("opt3")
};
form.addElement("Select Option: ");
form.addElement(new Select("opts", myOpts));
I'll try and pull down a current tree this evening and verify that what you are
describing is the correct behavior, unless someone beats me to it.
-stephan
George Armhold <[EMAIL PROTECTED]> on 09/06/2000 01:53:08 PM
Please respond to "ECS" <[EMAIL PROTECTED]>
To: ECS <[EMAIL PROTECTED]>
cc: (bcc: Stephan Nagy/TheSphereHQ)
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]