IDependOn-Set: 1
IDependOn-Set: 122
IDependOn-Set: 243
IDependOn-Set: 244
IDependOn-Set: 245
LastModifiedSecs: 931371611
Parent: 244
SequenceNumber: 2
Title: Using the Select element
Part: 0
Author-Set: jon@working-dogs.com
HideAttributions: 1
LastModifiedSecs: 931371479
Type: monospaced
Lines: 41
----------
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
EndPart: 0
