Okay I see what you are trying to do. 
Here is a suggestion from the top of my head:

Create a new action class which uses the same form as the Action in question
(populateDataSourceAction or something...).
Use this class to load the data from the DB into the blockDataSource field
in the form.
Put the form in the request space like this in the Action:

aRequest.setAttribute(anActionMapping.getName(), myActionForm) 

then forward it to the JSP page. 
Do not do any funky javascript stuff (onLoad etc etc)

It should work without it!!

--Amit

-----Original Message-----
From: atta-ur rehman [mailto:[EMAIL PROTECTED]
Sent: Monday, July 21, 2003 1:52 PM
To: Struts Users Mailing List
Subject: Re: A column consisting of html:select widgets


okay, here goes my JSP code:

REPATE FOR ALL THE BLOCKS
<html:select property="blockDataSource" style="WIDTH: 110px; font-size: 8pt"
onchange="blockDataSourceChanged();">
      <html:options collection="blockDataSourceList" property="value"
labelProperty="label"/>
</html:select>
END REPEAT

The "blockDataSourceList" is an ArrayList of LabelValueBean class and is in
the session scope. On the page load, I'm setting
Form.setBlockDataSource(String[]) to appropriate string array represneting
the saved value for the row.

My dropdowns always show the first option selected.

Thanks for the help.

ATTA

----- Original Message ----- 
From: "Amit Kirdatt" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 11:30 AM
Subject: RE: A column consisting of html:select widgets


> Atta,
>
> Can you post the relevant code both JSP and Java objects for us to look at
> and point you in the right direction?
>
> Thanks,
> Amit
>
> -----Original Message-----
> From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 21, 2003 1:27 PM
> To: Struts Users Mailing List
> Subject: Re: A column consisting of html:select widgets
>
>
> Thanks Amit.
>
> And that's exactly what i'm doing! Still i fails to show the correct
option
> for the dropdowns.
>
> Are you sure its available in struts 1.0? moreover, is my approach to
define
> String[] getter/setter is correct?
>
> ATTA
>
> ----- Original Message ----- 
> From: "Amit Kirdatt" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Monday, July 21, 2003 10:58 AM
> Subject: RE: A column consisting of html:select widgets
>
>
> > Atta,
> >
> > In your JSP page do the following
> >
> > <html:select property="item">
> > <html:options collection="myOptions" property="value"
> > labelProperty="label"/>
> > </html:select>
> >
> > Where the collection myOptions is a List of beans. Those beans have two
> > fields value and label
> >
> > Hope that helps!
> >
> >
> > -----Original Message-----
> > From: atta-ur rehman [mailto:[EMAIL PROTECTED]
> > Sent: Monday, July 21, 2003 12:46 PM
> > To: Struts Users Mailing List
> > Subject: A column consisting of html:select widgets
> >
> >
> > Dear All,
> >
> > I'm using struts 1.0.2.
> >
> > I have a requirement where i need to show a column consisting of
dropdown
> > lists. Every row of the table for the column shows a dropdown with the
> same
> > list of options.
> >
> > I've used String[] getCategory() and setCategory(String[]) getter/setter
> in
> > thr ActionForm. On the form submission i get the correct selected values
> for
> > all the rows. Now my questions is how do I set the values of these
> dropdown
> > from he database when the page is shown for the very first time. I've
> tried
> > setCategory(String[]) setter, but the dropdowns don't show the correct
> > option selected!
> >
> > I've also tried to search from the mail archive to no avail.
> >
> > Any help or pointers would be greatly appreciated.
> >
> > Regards,
> >
> > ATTA
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > This e-mail, including attachments, may include confidential and/or
> > proprietary information, and may be used only by the person or entity to
> > which it is addressed. If the reader of this e-mail is not the intended
> > recipient or his or her authorized agent, the reader is hereby notified
> that
> > any dissemination, distribution or copying of this e-mail is prohibited.
> If
> > you have received this e-mail in error, please notify the sender by
> replying
> > to this message and delete this e-mail immediately.
> >
> > ---------------------------------------------------------------------
> > 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]
>
>
> This e-mail, including attachments, may include confidential and/or
> proprietary information, and may be used only by the person or entity to
> which it is addressed. If the reader of this e-mail is not the intended
> recipient or his or her authorized agent, the reader is hereby notified
that
> any dissemination, distribution or copying of this e-mail is prohibited.
If
> you have received this e-mail in error, please notify the sender by
replying
> to this message and delete this e-mail immediately.
>
> ---------------------------------------------------------------------
> 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]


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified that
any dissemination, distribution or copying of this e-mail is prohibited. If
you have received this e-mail in error, please notify the sender by replying
to this message and delete this e-mail immediately.

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

Reply via email to