Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Element Construction Set : (Category) Examples :
Using the Select element
----------
From: "jon *" jon@clearink.com
To: ECS ecs@list.working-dogs.com
Subject: Re: Element
Date: Wed, Jul 7, 1999, 11:15 AM


> I am trying to create a Select( ) area and add some choices to it.  I am a
> little unclear on what determines something an element.  I believe it is an
> object with properties and methods, but I do not know how to create one with
> a name and a value that could be used in my select( ).

Select s = new Select().addElement ( new Option ( "Name", 1 ) );

That should create:

select
    <option value="1">Name
/select

Say that you want to create a bunch of option elements, just put things
into a loop:

Select s = new Select();
int MAX = 5;
for ( int i=1;i<=MAX;i++ )
{
    s.addElement ( new Option ( "Name " + i, i ) );
}

select
    <option value="1">Name 1
    <option value="2">Name 2
    <option value="3">Name 3
    <option value="4">Name 4
    <option value="5">Name 5
/select

I hope that helps,

-jon
[Append to This Answer]
Next: (Answer) Setting VAlign attributes
This document is: http://java.apache.org/faq/?file=243
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.