Stephan:

I made a dumb casting mistake and it is now
working.  Thanks for responding.

I have 2 more questions.

QUESTION 1:
I have created a select object with
4 options. How can I select the 3rd 
option by value?

For example, is there a way to do the following:
Select mySelect = new Select("Test");
Option option1               =  new Option("Option 1");
Option option2               =  new Option("Option 2");
Option option3               =  new Option("Option 3");
Option option4               =  new Option("Option 4");
option1.addElement("HELLO1");
option2.addElement("HELLO2");
option3.addElement("HELLO3");
option4.addElement("HELLO4");
option5.addElement("HELLO5");
mySelect.addElement(option1);
mySelect.addElement(option2);
mySelect.addElement(option3);
mySelect.addElement(option4);

mySelect.selectElementByValue("Option 3");<----------------HOW CAN I DO
THIS?

QUESTION 2:
Is there a way to determine the number of options in a Select object?

Once Again Many Thanks:

Alex


-----Original Message-----
From: Stephan Nagy [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 3:24 PM
To: [EMAIL PROTECTED]
Subject: Re: How do I Copy/Clone an "extended" Select Object????


That should work, as Select just extends MultiPartElement which extends
ConcreteElement which implements Cloneable.  Just out of curiosity can you
duplicate the problem outside the scope of your jsp page?

-stephan

"RESTREPO, ALEXANDER G [Non-Pharmacia/1000]" wrote:

> Hello:
>
> I have extended the Select list object and
> I am havin trouble cloning my new object.
>
> I have a class called DropDown which extends
> Select. i.e.,
>
> public class DropDown extends Select
> {
>    blah blah.....
> }
>
> When I do try to clone the DropDown object
> I created I get an error at runtime in my JSP.
>
> DropDown originalDropDown    =  new DropDown("TEST");
> Option option1               =  new Option("Option 1");
> Option option2               =  new Option("Option 2");
> Option option3               =  new Option("Option 3");
> Option option4               =  new Option("Option 4");
> DropDown.addElement(option1);
> DropDown.addElement(option2);
> DropDown.addElement(option3);
> DropDown.addElement(option4);
> DropDown newDropDown         =  originalDropDown.clone(); <---THIS IS
WHERE
> I GET THE ERROR
>
> Cloning the original Select object does not cause any problems..i.e.,
>
> Select clonedSelect = origSelect.clone();
>
> Could someone give me some insight in what I am doing wrong?
>
> Many Thanks:
>
> Alex Restrepo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to