Are you sure that you can see the scoped bean. Try some debugging
to the console.

<%
     System.out.println( "*ACE* news letter form bean ="+
     pageContext.findAttribute( "newsletterForm" ) );
%>

--
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: "Tricia Ong Cheah Yen" <[EMAIL PROTECTED]> on 21/11/2001 11:51 ZE8

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

To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc:
Subject:  RE: Options tag question


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]>






--

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]>

Reply via email to