struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark <markl...@libero.it>
Subject Re: OptionsCollection
Date Fri, 13 Dec 2002 11:11:45 GMT
Okay... But a drop down menu is screen data.

And a list of companies is something that will be used more than once.

So I have a normal class in my model layer

ListCompanies

In my UserAction

(ListCompanies).getCompanies();

But this Action's primary job is to return a list of users (which it does).

As the list is screen data i should be defining this in my form bean? This
is something thats being confusing me for weeks. If i've a bunch of
collections how can i make them available to iterate tags and select menus,
without using useBean (sorry silly design constraint, but beyond my
control).

Hopefully I'm just being silly, i could really do with some pointers as
where i'm missing the point.

Cheers mark


On 13-12-2002 11:49, "shirishchandra.sakhare@ubs.com"
<shirishchandra.sakhare@ubs.com> wrote:

> Also i dont understand why u need to access the request directly.I mean why
> are 
> u setting all the collections as request attributes.GEnerally I think the good
> design is when u r FormBEan represents the screen data.So in this case
> whatever 
> u need on screen will become attribute of form.
> I know it does not make much difference in implemantation but as a design it
> becomes pretty straight forward.I mean for an action , if u just look at the
> form, u know what is being displayed.So u just populate the form in action.
> 
> Any comments... :-))
> 
> 
> -----Original Message-----
> From: VEDRE [mailto:VEDRE@engr.sc.edu]
> Sent: Friday, December 13, 2002 11:44 AM
> To: struts-user
> Cc: VEDRE
> Subject: RE: OptionsCollection
> 
> 
> You can either use attribute collection="users" for options tag if you store
> in request
> or you can use               name="formName" property="myList"   if you have
> a getMyList() method for the form(You have to fill call formName.setMyList()
> in your action class before forwarding to a jsp).
> 
> 
> checkout http://jakarta.apache.org/struts/userGuide/struts-html.html#options
> if you have not looked at the documentation.
> 
> -rana.
> 
> 
> -----Original Message-----
> From: Mark [mailto:marklowe@libero.it]
> Sent: Friday, December 13, 2002 5:36 AM
> To: Struts Users Mailing List
> Subject: OptionsCollection
> 
> 
> Hello
> 
> I've a number of collections already defined that end up being passed to my
> jsp's via the request object.
> 
> Users in this case is a map defined in my business logic class that does db
> queries.
> 
> users = (ListUsers).getUsers();
> 
> request.setAttribute("users",users);
> 
> 
> I itertate through this collection using iterate. But now i want to use this
> in a select menu.
> 
> Should I be thinking about making my collection available to my FormBean i.e
> making a getMyList() method.
> 
> Thanks in advance
> 
> mark
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message