It looks to me like your <bean:define> and <html:options> tags are coded properly.  
You might want to check that your ArrayList is not empty which would probably cause 
the NPE.

I haven't used the scope and toscope parameters yet, but the documentation says that 
the toscope param is used when trying to use the <bean:define> tag to make a copy of a 
bean from one scope (scope) and placing the copy in another scope (toscope).  If you 
are just creating a copy of the bean for use in the page, then there is no need to use 
the toscope param.

Good Luck

>>> [EMAIL PROTECTED] 11/20/01 09:51pm >>>
Peter, 
        When I used the <bean:define> tag together with <html:options>.
I had first define a
bean with a property that contains an ArrayList of LabelValueBeans.  But
the code fails to work. I'm getting a NullPointerException. 
 
    <bean:define id="travelPeriodList" name="newsletterForm"
property="travelDaysList"/>

      <html:select property="targetDuration" size="0" value="">
       <html:options collection="travelPeriodList" property="value"
labelProperty="label"/>
        </html:select>

And btw, can someone explains to me what's the difference between scope
and toScope? thanks

+trish


-----Original Message-----
From: Peter Pilgrim [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, November 20, 2001 10:49 PM
To: Struts Users Mailing List
Subject: Re: Options tag question

Unfortunately the current <html:options> requires that you use
<bean:define>
indirectly to use the tag.

<define:bean id="brokerLabelValues"
     name="brokerForm"
     property="brokers" />
<html:options collection="brokerLabelValues"
     property="value" labelProperty="label" />

--
Peter Pilgrim                 ++44 (0)207-545-9923
                                                      //_\\
"Mathematics is essentially the study of islands of  =======
disparate subjects in a sea of ignorance."           || ! ||
Andrew Wiles _____________


---------------------------------------- Message History
----------------------------------------


From: [EMAIL PROTECTED] on 20/11/2001 09:44 EST

Please respond to "Struts Users Mailing List"
<[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED] 
cc:
Subject:  Options tag question


In reworking my Action classes, I tried to package all values needed for
my
form in the form bean, so I included a property that contains an
ArrayList
of LabelValueBeans.

Can I refer to this property to populate the <html:options> tag?

This nested syntax doesn't seem to work:

<html:options collection="brokerForm.brokers" property="value"
labelProperty="label" />


Or should I go back to including the ArrayList as a request attribute
and
return it that way.

Lee






--

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.



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


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



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

Reply via email to